Modified `validate_workflow_specification` to accept new optional `validate_study_id` parameter.
We then pass validate_study_id on to WorkflowService.test_spec
This commit is contained in:
parent
d657744816
commit
0dfc96d7f6
|
@ -46,16 +46,16 @@ def get_workflow_specification(spec_id):
|
|||
return WorkflowSpecModelSchema().dump(spec)
|
||||
|
||||
|
||||
def validate_workflow_specification(spec_id):
|
||||
def validate_workflow_specification(spec_id, validate_study_id=None):
|
||||
errors = {}
|
||||
try:
|
||||
WorkflowService.test_spec(spec_id)
|
||||
WorkflowService.test_spec(spec_id, validate_study_id)
|
||||
except ApiError as ae:
|
||||
ae.message = "When populating all fields ... \n" + ae.message
|
||||
errors['all'] = ae
|
||||
try:
|
||||
# Run the validation twice, the second time, just populate the required fields.
|
||||
WorkflowService.test_spec(spec_id, required_only=True)
|
||||
WorkflowService.test_spec(spec_id, validate_study_id, required_only=True)
|
||||
except ApiError as ae:
|
||||
ae.message = "When populating only required fields ... \n" + ae.message
|
||||
errors['required'] = ae
|
||||
|
|
Loading…
Reference in New Issue