mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-30 18:13:23 +08:00
redirect to run page if version is specified
This commit is contained in:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user