Skip to content

Commit

Permalink
Only add user data table if we have a tool data table name reference
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Feb 16, 2024
1 parent a5134ed commit 9d7a012
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/galaxy/tools/parameters/dynamic_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,15 +762,16 @@ def get_fields(self, trans, other_values):
def get_user_options(self, user: User):
# stored metadata are key: value pairs, turn into flat lists of correct order
fields = []
hdas = user.get_user_data_tables(self.tool_data_table_name)
by_dbkey = {}
for hda in hdas:
by_dbkey.update(self.hda_to_table_entries(hda, self.tool_data_table_name))
for data_table_entry in by_dbkey.values():
field_entry = []
for column_key in self.tool_data_table.columns.keys():
field_entry.append(data_table_entry[column_key])
fields.append(field_entry)
if self.tool_data_table_name:
hdas = user.get_user_data_tables(self.tool_data_table_name)
by_dbkey = {}
for hda in hdas:
by_dbkey.update(self.hda_to_table_entries(hda, self.tool_data_table_name))
for data_table_entry in by_dbkey.values():
field_entry = []
for column_key in self.tool_data_table.columns.keys():
field_entry.append(data_table_entry[column_key])
fields.append(field_entry)
return fields

@staticmethod
Expand Down

0 comments on commit 9d7a012

Please sign in to comment.