master
Aevann1 2021-07-28 07:04:30 +02:00
parent b42af16422
commit bfc31c9c0e
3 changed files with 4 additions and 3 deletions

View File

@ -960,7 +960,7 @@ def save_comment(cid, v):
g.db.add(new_save)
try: g.db.flush()
except: abort(422)
except: g.db.rollback()
return "", 204

View File

@ -1138,7 +1138,7 @@ def save_post(pid, v):
g.db.add(new_save)
try: g.db.flush()
except: abort(422)
except: g.db.rollback()
return "", 204

View File

@ -149,7 +149,8 @@ def api_vote_comment(comment_id, new, v):
g.db.add(vote)
g.db.flush()
try: g.db.flush()
except: g.db.rollback()
comment.upvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, vote_type=1).count()
comment.downvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, vote_type=-1).count()
g.db.add(comment)