forked from rDrama/rDrama
parent
856a2c905c
commit
7e7450ef33
|
@ -138,7 +138,7 @@ def api_vote_comment(comment_id, new, v):
|
||||||
|
|
||||||
comment = get_comment(comment_id)
|
comment = get_comment(comment_id)
|
||||||
|
|
||||||
if comment.author_id in poll_bots: return {"error": "forbidden."}, 403
|
if new == 1 and comment.author_id in poll_bots: return {"error": "forbidden."}, 403
|
||||||
|
|
||||||
existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
|
existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
|
||||||
|
|
||||||
|
@ -287,4 +287,4 @@ def api_vote_choice(comment_id, v):
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
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()
|
||||||
g.db.add(comment)
|
g.db.add(comment)
|
||||||
return "", 204
|
return "", 204
|
||||||
|
|
Loading…
Reference in New Issue