master
Aevann1 2021-09-18 21:59:21 +02:00
parent 568a3700f0
commit 36b3617edf
1 changed files with 5 additions and 4 deletions

View File

@ -901,7 +901,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!"}
@ -914,8 +915,8 @@ def unsave_comment(cid, v):
save=g.db.query(SaveRelationship).options(lazyload('*')).filter_by(user_id=v.id, submission_id=comment.id, type=2).first()
if save: g.db.delete(save)
g.db.commit()
if save:
g.db.delete(save)
g.db.commit()
return {"message": "Comment unsaved!"}