fix 500 error
parent
94aa90ac04
commit
383528127c
|
@ -113,7 +113,7 @@ def purchase_lottery_tickets(v, quantity=1):
|
||||||
if quantity > 1:
|
if quantity > 1:
|
||||||
charge_reason += 's'
|
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"
|
return False, "You don't have enough coins"
|
||||||
|
|
||||||
v.currently_held_lottery_tickets += quantity
|
v.currently_held_lottery_tickets += quantity
|
||||||
|
|
|
@ -36,7 +36,7 @@ def create_group(v):
|
||||||
abort(400, "This group already exists!")
|
abort(400, "This group already exists!")
|
||||||
|
|
||||||
charge_reason = f'Cost of creating <a href="/!{name}">!{name}</a>'
|
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!")
|
abort(403, "You don't have enough coins or marseybux!")
|
||||||
|
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
|
|
@ -394,7 +394,7 @@ def create_sub2(v):
|
||||||
abort(400, "Name does not match the required format!")
|
abort(400, "Name does not match the required format!")
|
||||||
|
|
||||||
charge_reason = f'Cost of creating <a href="/h/{name}">/h/{name}</a>'
|
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!")
|
abort(400, "You don't have enough coins or marseybux!")
|
||||||
|
|
||||||
hole = get_hole(name, graceful=True)
|
hole = get_hole(name, graceful=True)
|
||||||
|
|
|
@ -26,7 +26,7 @@ def vote_option(option_id, v):
|
||||||
if option.exclusive == 2:
|
if option.exclusive == 2:
|
||||||
if option.parent.total_bet_voted(v):
|
if option.parent.total_bet_voted(v):
|
||||||
abort(403, "You can't participate in a closed bet!")
|
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!")
|
abort(400, f"You don't have {POLL_BET_COINS} coins or marseybux!")
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ def vote_option_comment(option_id, v):
|
||||||
if option.exclusive == 2:
|
if option.exclusive == 2:
|
||||||
if option.parent.total_bet_voted(v):
|
if option.parent.total_bet_voted(v):
|
||||||
abort(403, "You can't participate in a closed bet!")
|
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!")
|
abort(400, f"You don't have {POLL_BET_COINS} coins or marseybux!")
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
|
||||||
|
|
|
@ -380,7 +380,7 @@ def settings_personal_post(v):
|
||||||
else:
|
else:
|
||||||
cost = HOUSE_JOIN_COST
|
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 not success: abort(403)
|
||||||
|
|
||||||
if house == "None":
|
if house == "None":
|
||||||
|
|
Loading…
Reference in New Issue