diff --git a/crc/api/workflow.py b/crc/api/workflow.py index 10fb3ce0..223f280f 100644 --- a/crc/api/workflow.py +++ b/crc/api/workflow.py @@ -91,7 +91,7 @@ def delete_workflow_specification(spec_id): # Delete all events and workflow models related to this specification for workflow in session.query(WorkflowModel).filter_by(workflow_spec_id=spec_id): - StudyService.delete_workflow(workflow) + StudyService.delete_workflow(workflow.id) session.query(WorkflowSpecModel).filter_by(id=spec_id).delete() session.commit() diff --git a/crc/services/study_service.py b/crc/services/study_service.py index 3befb382..fab76542 100644 --- a/crc/services/study_service.py +++ b/crc/services/study_service.py @@ -79,7 +79,7 @@ class StudyService(object): def delete_study(study_id): session.query(TaskEventModel).filter_by(study_id=study_id).delete() for workflow in session.query(WorkflowModel).filter_by(study_id=study_id): - StudyService.delete_workflow(workflow) + StudyService.delete_workflow(workflow.id) session.query(StudyModel).filter_by(id=study_id).delete() session.commit()