diff --git a/crc/api.py b/crc/api.py index c954166b..ced00cb1 100644 --- a/crc/api.py +++ b/crc/api.py @@ -59,6 +59,7 @@ def add_workflow_to_study(study_id, body): study_id=study_id, workflow_spec_id=workflow_spec_model.id) db.session.add(workflow) + db.session.commit() def get_workflow(workflow_id): return db.session.query(WorkflowModel).filter_by(id=workflow_id).first() diff --git a/tests/test_api.py b/tests/test_api.py index ed0e913c..a906536e 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -60,4 +60,5 @@ class TestStudy(BaseTest, unittest.TestCase): self.assertEqual(study.id, workflow.study_id) self.assertEqual(WorkflowStatus.user_input_required, workflow.status) self.assertIsNotNone(workflow.bpmn_workflow_json) - self.assertEqual(spec.id, workflow.workflow_spec_id) \ No newline at end of file + self.assertEqual(spec.id, workflow.workflow_spec_id) +