Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.05] Create empty history if history is unavailable during api call #217

Merged
merged 3 commits into from
May 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/galaxy/tools/parameters/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ def _get_history( self, trans, history=None ):
class_name = self.__class__.__name__
assert trans is not None, "%s requires a trans" % class_name
if history is None:
history = trans.get_history()
history = trans.get_history( create=True )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a second set of lines, should we just pass create=True to the invocation above?

assert history is not None, "%s requires a history" % class_name
return history

Expand Down
2 changes: 1 addition & 1 deletion test/unit/tools/test_data_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def setUp( self ):
self.app.model.context.flush()
self.trans = bunch.Bunch(
app=self.app,
get_history=lambda: self.test_history,
get_history=lambda **k: self.test_history,
get_current_user_roles=lambda: [],
workflow_building_mode=False,
webapp=bunch.Bunch( name="galaxy" ),
Expand Down
2 changes: 1 addition & 1 deletion test/unit/tools/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def __init__( self, app, history ):
self.webapp = Bunch( name="galaxy" )
self.sa_session = self.app.model.context

def get_history( self ):
def get_history( self, **kwargs ):
return self.history


Expand Down
2 changes: 1 addition & 1 deletion test/unit/unittest_utils/galaxy_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def set_user( self, user ):

user = property( get_user, set_user )

def get_history( self ):
def get_history( self, **kwargs ):
return self.history

def set_history( self, history ):
Expand Down