We weren't committing to the database in the correct spot, so the delete wasn't sticking, and we were ending up with test workflows showing up in the main interface.

This commit is contained in:
Dan 2021-06-23 16:39:58 -04:00
parent e4140dec9f
commit 628a587d97
1 changed files with 1 additions and 1 deletions

View File

@ -88,10 +88,10 @@ class WorkflowService(object):
# Also, delete any test study or user models that may have been created.
for study in db.session.query(StudyModel).filter(StudyModel.user_uid == "test"):
StudyService.delete_study(study.id)
db.session.commit()
user = db.session.query(UserModel).filter_by(uid="test").first()
if user:
db.session.delete(user)
db.session.commit()
@staticmethod
@timeit