move task draft data insert into try statement to handle Deadlock errors

This commit is contained in:
jasquat 2023-10-02 08:35:00 -04:00
parent e3f775e54f
commit a9877c116b
1 changed files with 1 additions and 1 deletions

View File

@ -714,8 +714,8 @@ def task_save_draft(
json_data_dict = JsonDataModel.json_data_dict_from_dict(body) json_data_dict = JsonDataModel.json_data_dict_from_dict(body)
JsonDataModel.insert_or_update_json_data_dict(json_data_dict) JsonDataModel.insert_or_update_json_data_dict(json_data_dict)
task_draft_data_dict["saved_form_data_hash"] = json_data_dict["hash"] task_draft_data_dict["saved_form_data_hash"] = json_data_dict["hash"]
TaskDraftDataModel.insert_or_update_task_draft_data_dict(task_draft_data_dict)
try: try:
TaskDraftDataModel.insert_or_update_task_draft_data_dict(task_draft_data_dict)
db.session.commit() db.session.commit()
except OperationalError as exception: except OperationalError as exception:
db.session.rollback() db.session.rollback()