fix 500 error

pull/225/head
Aevann 2024-03-09 14:19:38 +02:00
parent 94aa90ac04
commit 383528127c
5 changed files with 6 additions and 6 deletions

View File

@ -113,7 +113,7 @@ def purchase_lottery_tickets(v, quantity=1):
if quantity > 1:
charge_reason += 's'
if not v.charge_account('coins', LOTTERY_TICKET_COST * quantity, charge_reason)[0]:
if not v.charge_account('coins', LOTTERY_TICKET_COST * quantity, charge_reason):
return False, "You don't have enough coins"
v.currently_held_lottery_tickets += quantity

View File

@ -36,7 +36,7 @@ def create_group(v):
abort(400, "This group already exists!")
charge_reason = f'Cost of creating <a href="/!{name}">!{name}</a>'
if not v.charge_account('coins/marseybux', GROUP_COST, charge_reason)[0]:
if not v.charge_account('coins/marseybux', GROUP_COST, charge_reason):
abort(403, "You don't have enough coins or marseybux!")
g.db.add(v)

View File

@ -394,7 +394,7 @@ def create_sub2(v):
abort(400, "Name does not match the required format!")
charge_reason = f'Cost of creating <a href="/h/{name}">/h/{name}</a>'
if not v.charge_account('coins/marseybux', HOLE_COST, charge_reason)[0]:
if not v.charge_account('coins/marseybux', HOLE_COST, charge_reason):
abort(400, "You don't have enough coins or marseybux!")
hole = get_hole(name, graceful=True)

View File

@ -26,7 +26,7 @@ def vote_option(option_id, v):
if option.exclusive == 2:
if option.parent.total_bet_voted(v):
abort(403, "You can't participate in a closed bet!")
if not v.charge_account('coins/marseybux', POLL_BET_COINS, f"Cost of bet on {option.parent.textlink}")[0]:
if not v.charge_account('coins/marseybux', POLL_BET_COINS, f"Cost of bet on {option.parent.textlink}"):
abort(400, f"You don't have {POLL_BET_COINS} coins or marseybux!")
g.db.add(v)
@ -79,7 +79,7 @@ def vote_option_comment(option_id, v):
if option.exclusive == 2:
if option.parent.total_bet_voted(v):
abort(403, "You can't participate in a closed bet!")
if not v.charge_account('coins/marseybux', POLL_BET_COINS, f"Cost of bet on {option.parent.textlink}")[0]:
if not v.charge_account('coins/marseybux', POLL_BET_COINS, f"Cost of bet on {option.parent.textlink}"):
abort(400, f"You don't have {POLL_BET_COINS} coins or marseybux!")
g.db.add(v)

View File

@ -380,7 +380,7 @@ def settings_personal_post(v):
else:
cost = HOUSE_JOIN_COST
success = v.charge_account('coins/marseybux', cost, "Cost of changing houses")[0]
success = v.charge_account('coins/marseybux', cost, "Cost of changing houses")
if not success: abort(403)
if house == "None":