From d136ae163caaf9dd70855a540ef72944d717917c Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 25 Apr 2023 06:47:36 +0200 Subject: [PATCH] fix combined buy btn --- files/routes/awards.py | 4 ++-- files/routes/hats.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index 2ce9af6c9..c2f987293 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -81,8 +81,8 @@ def buy(v:User, award): else: currency = 'combined' - charged = v.charge_account(currency, price)[0] - if not charged: + charged = v.charge_account(currency, price) + if not charged[0]: abort(400, "Not enough coins/marseybux!") v.coins_spent += charged[1] diff --git a/files/routes/hats.py b/files/routes/hats.py index 7e0845068..25d0760e5 100644 --- a/files/routes/hats.py +++ b/files/routes/hats.py @@ -47,8 +47,9 @@ def buy_hat(v:User, hat_id): if not hat.is_purchasable: abort(403, "This hat is not for sale!") - charged = v.charge_account('combined', hat.price)[0] - if not charged: abort(400, "Not enough coins/marseybux!") + charged = v.charge_account('combined', hat.price) + if not charged[0]: + abort(400, "Not enough coins/marseybux!") v.coins_spent_on_hats += charged[1] hat.author.pay_account('coins', hat.price * 0.1)