[17.01] Make active_datasets_children_and_roles just active_datasets_and_roles.

I guess somewhere in the tool building process we eliminated children from appearing the form. Remove unused code that used the children selector in the tool form.
This commit is contained in:
John Chilton
2017-02-16 13:11:20 -05:00
parent 29d229cedd
commit ac191f5f2a
2 changed files with 7 additions and 27 deletions
+5 -6
View File
@@ -1406,20 +1406,19 @@ class History( object, Dictifiable, UsesAnnotations, HasName ):
return galaxy.util.nice_size( self.disk_size )
@property
def active_datasets_children_and_roles( self ):
if not hasattr(self, '_active_datasets_children_and_roles'):
def active_datasets_and_roles( self ):
if not hasattr(self, '_active_datasets_and_roles'):
db_session = object_session( self )
query = ( db_session.query( HistoryDatasetAssociation )
.filter( HistoryDatasetAssociation.table.c.history_id == self.id )
.filter( not_( HistoryDatasetAssociation.deleted ) )
.order_by( HistoryDatasetAssociation.table.c.hid.asc() )
.options( joinedload("children"),
joinedload("dataset"),
.options( joinedload("dataset"),
joinedload("dataset.actions"),
joinedload("dataset.actions.role"),
))
self._active_datasets_children_and_roles = query.all()
return self._active_datasets_children_and_roles
self._active_datasets_and_roles = query.all()
return self._active_datasets_and_roles
@property
def active_contents( self ):
+2 -21
View File
@@ -1461,7 +1461,7 @@ class BaseDataToolParameter( ToolParameter ):
if history is not None:
dataset_matcher = DatasetMatcher( trans, self, None, other_values )
if isinstance( self, DataToolParameter ):
for hda in reversed( history.active_datasets_children_and_roles ):
for hda in reversed( history.active_datasets_and_roles ):
match = dataset_matcher.hda_match( hda, check_security=False )
if match:
return match.hda
@@ -1582,25 +1582,6 @@ class DataToolParameter( BaseDataToolParameter ):
if dataset_collection_matcher.hdca_match( history_dataset_collection, reduction=reduction ):
yield history_dataset_collection
def match_datasets( self, history, dataset_matcher ):
def dataset_collector( hdas, parent_hid ):
for i, hda in enumerate( hdas ):
if parent_hid is not None:
hid = "%s.%d" % ( parent_hid, i + 1 )
else:
hid = str( hda.hid )
hda_match = dataset_matcher.hda_match( hda )
if not hda_match:
continue
yield (hda_match, hid)
# Also collect children via association object
for item in dataset_collector( hda.children, hid ):
yield item
for item in dataset_collector( history.active_datasets_children_and_roles, None ):
yield item
def from_json( self, value, trans, other_values={} ):
if trans.workflow_building_mode is workflow_building_modes.ENABLED:
return None
@@ -1799,7 +1780,7 @@ class DataToolParameter( BaseDataToolParameter ):
# add datasets
visible_hda = other_values.get( self.name )
has_matched = False
for hda in history.active_datasets_children_and_roles:
for hda in history.active_datasets_and_roles:
match = dataset_matcher.hda_match( hda, check_security=False )
if match:
m = match.hda