fix combined buy btn

pull/143/head
Aevann 2023-04-25 06:47:36 +02:00
parent 562388de65
commit d136ae163c
2 changed files with 5 additions and 4 deletions

View File

@ -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]

View File

@ -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)