forked from rDrama/rDrama
dffd
parent
b42af16422
commit
bfc31c9c0e
|
@ -960,7 +960,7 @@ def save_comment(cid, v):
|
||||||
g.db.add(new_save)
|
g.db.add(new_save)
|
||||||
|
|
||||||
try: g.db.flush()
|
try: g.db.flush()
|
||||||
except: abort(422)
|
except: g.db.rollback()
|
||||||
|
|
||||||
return "", 204
|
return "", 204
|
||||||
|
|
||||||
|
|
|
@ -1138,7 +1138,7 @@ def save_post(pid, v):
|
||||||
g.db.add(new_save)
|
g.db.add(new_save)
|
||||||
|
|
||||||
try: g.db.flush()
|
try: g.db.flush()
|
||||||
except: abort(422)
|
except: g.db.rollback()
|
||||||
|
|
||||||
return "", 204
|
return "", 204
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,8 @@ def api_vote_comment(comment_id, new, v):
|
||||||
|
|
||||||
g.db.add(vote)
|
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.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()
|
comment.downvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, vote_type=-1).count()
|
||||||
g.db.add(comment)
|
g.db.add(comment)
|
||||||
|
|
Loading…
Reference in New Issue