From 090b6af592182bed9df4eafb9b3a857afefceed8 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 1 Aug 2019 11:52:11 +0200 Subject: [PATCH] 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. --- lib/galaxy/webapps/galaxy/api/workflows.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 51d21275bcc..7a03f34b8be 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -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: