From bb4000ff6dc442e8d98e7ec5de21c6496e1bab59 Mon Sep 17 00:00:00 2001 From: Dan Funk Date: Mon, 6 Jul 2020 16:01:43 -0400 Subject: [PATCH] Don't attept to load up the workflows for abandoned studies. --- crc/services/study_service.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crc/services/study_service.py b/crc/services/study_service.py index 90331f54..f07c82c8 100644 --- a/crc/services/study_service.py +++ b/crc/services/study_service.py @@ -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