From 67fa522b824829c6424938ac01992ce06845e882 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 1 Jul 2023 00:49:10 +0300 Subject: [PATCH] dont use pay_account and charge_account in votes --- files/routes/votes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/routes/votes.py b/files/routes/votes.py index c50afe5abf..3e635baf22 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -97,14 +97,14 @@ def vote_post_comment(target_id, new, v, cls, vote_cls): if existing and existing.vote_type == new: return "", 204 if existing: if existing.vote_type == 0 and new != 0: - target.author.pay_account('coins', coin_value) + target.author.coins += coin_value target.author.truescore += coin_delta g.db.add(target.author) existing.vote_type = new existing.coins = coin_value g.db.add(existing) elif existing.vote_type != 0 and new == 0: - target.author.charge_account('coins', existing.coins, should_check_balance=False) + target.author.coins -= existing.coins target.author.truescore -= coin_delta g.db.add(target.author) g.db.delete(existing) @@ -112,7 +112,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls): existing.vote_type = new g.db.add(existing) elif new != 0: - target.author.pay_account('coins', coin_value) + target.author.coins += coin_value target.author.truescore += coin_delta g.db.add(target.author)