Unverified Commit de794dd9 authored by Dannon's avatar Dannon Committed by GitHub
Browse files

Merge pull request #6774 from mvdbeek/fix_old_wf_name

[18.05] Update name of Workflow when updating StoredWorkflow name
parents 9bc37c03 364e7e1f
......@@ -481,8 +481,15 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn
workflow_dict = payload.get('workflow') or payload
if workflow_dict:
new_workflow_name = workflow_dict.get('name') or workflow_dict.get('name')
if new_workflow_name:
stored_workflow.name = sanitize_html(new_workflow_name)
if new_workflow_name and new_workflow_name != stored_workflow.name:
sanitized_name = sanitize_html(new_workflow_name)
workflow = stored_workflow.latest_workflow.copy()
workflow.stored_workflow = stored_workflow
workflow.name = sanitized_name
stored_workflow.name = sanitized_name
stored_workflow.latest_workflow = workflow
trans.sa_session.add(workflow, stored_workflow)
if 'annotation' in workflow_dict:
newAnnotation = sanitize_html(workflow_dict['annotation'])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment