From 83c8af6f855ea0a1253f8f0edd6970fdd09a2a0d Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 10 Oct 2023 18:11:32 +0300 Subject: [PATCH] dont repeat urself --- files/routes/awards.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index efd8a893b..2776317d3 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -215,11 +215,12 @@ def award_thing(v, thing_type, id): else: awarded_coins = 0 - if kind == 'shit': - author.charge_account('coins', awarded_coins, should_check_balance=False) - v.pay_account('coins', awarded_coins) - elif AWARDS[kind]['cosmetic']: - author.pay_account('coins', awarded_coins) + if awarded_coins: + if kind == 'shit': + author.charge_account('coins', awarded_coins, should_check_balance=False) + v.pay_account('coins', awarded_coins) + else: + author.pay_account('coins', awarded_coins) if thing_type == 'comment': link_text_in_notif = "your comment"