From 14926499dc1be233cfc9d16878dcc8b61ed9e577 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 7 Oct 2021 08:43:42 +0200 Subject: [PATCH] vcxxvc --- files/routes/votes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/files/routes/votes.py b/files/routes/votes.py index e70a3c2b2..af1184972 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -87,6 +87,9 @@ def api_vote_post(post_id, new, v): post.author.truecoins -= 1 g.db.add(post.author) g.db.delete(existing) + else: + existing.vote_type = new + g.db.add(existing) elif new != 0: post.author.coins += 1 post.author.truecoins += 1 @@ -141,6 +144,9 @@ def api_vote_comment(comment_id, new, v): comment.author.truecoins -= 1 g.db.add(comment.author) g.db.delete(existing) + else: + existing.vote_type = new + g.db.add(existing) elif new != 0: comment.author.coins += 1 comment.author.truecoins += 1