redirect to run page if version is specified

This commit is contained in:
Oleg Zharkov
2020-11-03 18:11:13 +01:00
parent 77e19d4918
commit 493d37fb2b
5 changed files with 30 additions and 11 deletions
+11 -4
View File
@@ -678,14 +678,21 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn
raise exceptions.MessageException("The data content is missing.")
raw_workflow_description = self.__normalize_workflow(trans, data)
workflow, missing_tool_tups = self._workflow_from_dict(trans, raw_workflow_description, source=source)
workflow_id = workflow.id
workflow = workflow.latest_workflow
response = {"message": "Workflow '%s' imported successfully." % escape(workflow.name), "status": "success",
"id": trans.security.encode_id(workflow_id)}
if workflow.has_errors:
return {"message": "Imported, but some steps in this workflow have validation errors.", "status": "error"}
response["message"] = "Imported, but some steps in this workflow have validation errors."
response["status"] = "error"
elif len(workflow.steps) == 0:
return {"message": "Imported, but this workflow has no steps.", "status": "error"}
response["message"] = "Imported, but this workflow has no steps."
response["status"] = "error"
elif workflow.has_cycles:
return {"message": "Imported, but this workflow contains cycles.", "status": "error"}
return {"message": "Workflow '%s' imported successfully." % escape(workflow.name), "status": "success"}
response["message"] = "Imported, but this workflow contains cycles."
response["status"] = "error"
return response
def __api_import_new_workflow(self, trans, payload, **kwd):
data = payload['workflow']