diff --git a/files/routes/comments.py b/files/routes/comments.py index 09552ada4..b36b90478 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -849,7 +849,8 @@ def save_comment(cid, v): if not save: new_save=SaveRelationship(user_id=v.id, submission_id=comment.id, type=2) g.db.add(new_save) - g.db.commit() + try: g.db.commit() + except: g.db.rollback() return {"message": "Comment saved!"}