Merge pull request #386 from sartography/top-level-validation-460

Bug fix for top level validation #460
This commit is contained in:
Dan Funk 2021-09-30 16:20:27 -04:00 committed by GitHub
commit 03c7a5eee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ class WorkflowService(object):
study_model = session.query(StudyModel).filter(StudyModel.id == validate_study_id).first()
spec_model = session.query(WorkflowSpecModel).filter(WorkflowSpecModel.id == spec_id).first()
status = StudyService._get_study_status(study_model)
if status[spec_model.name]['status'] == 'disabled':
if spec_model.name in status and status[spec_model.name]['status'] == 'disabled':
raise ApiError(code='disabled_workflow', message=f"This workflow is disabled. {status[spec_model.name]['message']}")
workflow_model = WorkflowService.make_test_workflow(spec_id, validate_study_id)
try: