diff --git a/files/routes/awards.py b/files/routes/awards.py index 2ce9af6c97..c2f9872932 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 7e08450684..25d0760e52 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)