We want to modify the master workflow so that it returns both a status, and a message explaining the status for each workflow.
I.e., from status = {'ids_full_submission': 'required', 'enter_core_info': 'disabled', ...} to status = {'ids_full_submission': {'status': 'required', 'message': 'required because...'}, 'enter_core_info': {'status': 'disabled', 'message': 'disabled because...'}, ...} Modified study_service.__update_status_of_workflow_meta to accommodate this change.
This commit is contained in:
parent
14386b8ba9
commit
c05b879dd4
|
@ -421,13 +421,15 @@ class StudyService(object):
|
|||
warnings = []
|
||||
for wfm in workflow_metas:
|
||||
if wfm.name in status.keys():
|
||||
if not WorkflowState.has_value(status[wfm.name]):
|
||||
if not WorkflowState.has_value(status[wfm.name]['status']):
|
||||
warnings.append(ApiError("invalid_status",
|
||||
"Workflow '%s' can not be set to '%s', should be one of %s" % (
|
||||
wfm.name, status[wfm.name], ",".join(WorkflowState.list())
|
||||
)))
|
||||
else:
|
||||
wfm.state = WorkflowState[status[wfm.name]]
|
||||
wfm.state = WorkflowState[status[wfm.name]['status']]
|
||||
if status[wfm.name]['message']:
|
||||
wfm.state_message = status[wfm.name]['message']
|
||||
else:
|
||||
warnings.append(ApiError("missing_status", "No status specified for workflow %s" % wfm.name))
|
||||
return warnings
|
||||
|
|
Loading…
Reference in New Issue