fsd
This commit is contained in:
parent
e2f0394cbc
commit
2b835b0bf1
1 changed files with 5 additions and 4 deletions
|
@ -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!"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue