From aa1ba59bb1f1e12574835386251c74310a355735 Mon Sep 17 00:00:00 2001 From: alicia pritchett Date: Tue, 9 Nov 2021 10:42:47 -0500 Subject: [PATCH] Delete Task log model when deleting a study just a minor fix --- crc/services/study_service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crc/services/study_service.py b/crc/services/study_service.py index bdeb6fe0..95d4d69d 100755 --- a/crc/services/study_service.py +++ b/crc/services/study_service.py @@ -21,6 +21,7 @@ from crc.models.protocol_builder import ProtocolBuilderStudy, ProtocolBuilderSta from crc.models.study import StudyModel, Study, StudyStatus, Category, WorkflowMetadata, StudyEventType, StudyEvent, \ IrbStatus, StudyAssociated, StudyAssociatedSchema from crc.models.task_event import TaskEventModel, TaskEvent +from crc.models.task_log import TaskLogModel from crc.models.workflow import WorkflowSpecCategoryModel, WorkflowModel, WorkflowSpecModel, WorkflowState, \ WorkflowStatus, WorkflowSpecDependencyFile from crc.services.document_service import DocumentService @@ -215,6 +216,7 @@ class StudyService(object): @staticmethod def delete_study(study_id): session.query(TaskEventModel).filter_by(study_id=study_id).delete() + session.query(TaskLogModel).filter_by(study_id=study_id).delete() session.query(StudyAssociated).filter_by(study_id=study_id).delete() session.query(EmailModel).filter_by(study_id=study_id).delete() session.query(StudyEvent).filter_by(study_id=study_id).delete()