mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #217 from guerler/fix_missing_history
[15.05] Create empty history if history is unavailable during api call
This commit is contained in:
@@ -1634,7 +1634,7 @@ class BaseDataToolParameter( ToolParameter ):
|
||||
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 )
|
||||
assert history is not None, "%s requires a history" % class_name
|
||||
return history
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ class DataToolParameterTestCase( BaseParameterTestCase ):
|
||||
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" ),
|
||||
|
||||
@@ -478,7 +478,7 @@ class MockTrans( object ):
|
||||
self.webapp = Bunch( name="galaxy" )
|
||||
self.sa_session = self.app.model.context
|
||||
|
||||
def get_history( self ):
|
||||
def get_history( self, **kwargs ):
|
||||
return self.history
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class MockTrans( object ):
|
||||
|
||||
user = property( get_user, set_user )
|
||||
|
||||
def get_history( self ):
|
||||
def get_history( self, **kwargs ):
|
||||
return self.history
|
||||
|
||||
def set_history( self, history ):
|
||||
|
||||
Reference in New Issue
Block a user