Only set workflow tags if they are include in workflow update payload

We accept different kinds of payloads here. The summary payload
as sent by the workflow overview page includes a tags key,
while the workflow payload sent by the workflow editor only
includes the steps (tag updates are sent through a different
endpoint), so anytime a workflow is saved in the workflow editor
we would fallback to an empty list as the new tags, effectively
removing all tags.

Fixes https://github.com/galaxyproject/galaxy/issues/6888.
This commit is contained in:
mvdbeek
2019-08-01 11:52:23 +02:00
parent 868d3bd103
commit 090b6af592
+2 -1
View File
@@ -552,7 +552,8 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn
if (trans.security.decode_id(id) in entries):
trans.get_user().stored_workflow_menu_entries.remove(entries[trans.security.decode_id(id)])
# set tags
trans.app.tag_handler.set_tags_from_list(user=trans.user, item=stored_workflow, new_tags_list=workflow_dict.get('tags', []))
if 'tags' in workflow_dict:
trans.app.tag_handler.set_tags_from_list(user=trans.user, item=stored_workflow, new_tags_list=workflow_dict['tags'])
if 'steps' in workflow_dict:
try: