Skip to content

Commit

Permalink
Recover the correct DataCollectionToolParameter when checking if a co…
Browse files Browse the repository at this point in the history
…llection is being mapped over
  • Loading branch information
mvdbeek committed Jun 11, 2018
1 parent 258ccb8 commit fc06a7a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/galaxy/tools/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,22 @@ def create_collection(self, output, name, collection_type=None, **element_kwds):
raise Exception("Could not determine collection type to create.")
if collection_type_source not in input_collections:
raise Exception("Could not find collection type source with name [%s]." % collection_type_source)
collection_type_description = self.tool.inputs[collection_type_source]._history_query(self.trans).can_map_over(input_collections[collection_type_source])

# Using the collection_type_source string we get the DataCollectionToolParameter
data_param = self.tool.inputs
groups = collection_type_source.split('|')
for group in groups:
values = group.split('_')
if values[-1].isdigit():
key = ("_".join(values[0:-1]))
# We don't care about the repeat index, we just need to find the correct DataCollectionToolParameter
else:
key = group
if isinstance(data_param, odict):
data_param = data_param.get(key)
else:
data_param = data_param.inputs.get(key)
collection_type_description = data_param._history_query(self.trans).can_map_over(input_collections[collection_type_source])
if collection_type_description:
collection_type = collection_type_description.collection_type
else:
Expand Down

0 comments on commit fc06a7a

Please sign in to comment.