Don't attept to load up the workflows for abandoned studies.

This commit is contained in:
Dan Funk 2020-07-06 16:01:43 -04:00
parent 8a66128189
commit bb4000ff6d
1 changed files with 8 additions and 6 deletions

View File

@ -64,13 +64,15 @@ class StudyService(object):
study.files = list(files)
# Calling this line repeatedly is very very slow. It creates the
# master spec and runs it.
status = StudyService.__get_study_status(study_model)
study.warnings = StudyService.__update_status_of_workflow_meta(workflow_metas, status)
# master spec and runs it. Don't execute this for Abandoned studies, as
# we don't have the information to process them.
if study.protocol_builder_status != ProtocolBuilderStatus.ABANDONED:
status = StudyService.__get_study_status(study_model)
study.warnings = StudyService.__update_status_of_workflow_meta(workflow_metas, status)
# Group the workflows into their categories.
for category in study.categories:
category.workflows = {w for w in workflow_metas if w.category_id == category.id}
# Group the workflows into their categories.
for category in study.categories:
category.workflows = {w for w in workflow_metas if w.category_id == category.id}
return study