forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-07-26 02:34:07 +02:00
parent 0628c031dd
commit c13686205b
1 changed files with 6 additions and 6 deletions

View File

@ -145,17 +145,17 @@ def api_vote_comment(comment_id, x, v):
user_id=v.id, comment_id=comment.id).first()
if existing:
if existing == 0 and x != 0:
post.author.dramacoins += 1
g.db.add(post.author)
comment.author.dramacoins += 1
g.db.add(comment.author)
elif existing != 0 and x == 0:
post.author.dramacoins -= 1
g.db.add(post.author)
comment.author.dramacoins -= 1
g.db.add(comment.author)
existing.change_to(x)
g.db.add(existing)
else:
if x != 0:
post.author.dramacoins += 1
g.db.add(post.author)
comment.author.dramacoins += 1
g.db.add(comment.author)
vote = CommentVote(user_id=v.id,
vote_type=x,
comment_id=base36decode(comment_id),