Commit 364e7e1f authored by mvdbeek's avatar mvdbeek
Browse files

Update name of Workflow when updating StoredWorkflow name

parent 02c17715
......@@ -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: = sanitize_html(new_workflow_name)
if new_workflow_name and new_workflow_name !=
sanitized_name = sanitize_html(new_workflow_name)
workflow = stored_workflow.latest_workflow.copy()
workflow.stored_workflow = stored_workflow = sanitized_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