forked from MarseyWorld/MarseyWorld
casino shit
parent
cfa4231f7d
commit
eec0a6a436
|
@ -55,7 +55,7 @@ def inject_constants():
|
|||
"PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR,
|
||||
"COLORS":COLORS, "time":time, "PERMS":PERMS, "FEATURES":FEATURES,
|
||||
"HOLE_NAME":HOLE_NAME, "HOLE_STYLE_FLAIR":HOLE_STYLE_FLAIR, "HOLE_REQUIRED":HOLE_REQUIRED,
|
||||
"LOTTERY_ENABLED":CASINO_ENABLED, "GUMROAD_LINK":GUMROAD_LINK,
|
||||
"CASINO_ENABLED":CASINO_ENABLED, "GUMROAD_LINK":GUMROAD_LINK,
|
||||
"DEFAULT_THEME":DEFAULT_THEME, "DESCRIPTION":DESCRIPTION,
|
||||
"has_sidebar":has_sidebar, "has_logo":has_logo, "has_app":has_app,
|
||||
"FP":FP, "NOTIF_MODACTION_JL_MIN":NOTIF_MODACTION_JL_MIN, "cache":cache, "ONLINE_STR":ONLINE_STR, "patron":patron, "approved_embed_hosts":approved_embed_hosts, "dues":dues}
|
||||
|
|
|
@ -166,7 +166,7 @@ def admin_level_required(x):
|
|||
|
||||
return wrapper_maker
|
||||
|
||||
def lottery_required(f):
|
||||
def casino_required(f):
|
||||
def wrapper(*args, **kwargs):
|
||||
v = get_logged_in_user()
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import requests
|
|||
|
||||
@app.post("/lottery/end")
|
||||
@admin_level_required(3)
|
||||
@lottery_required
|
||||
@casino_required
|
||||
def lottery_end(v):
|
||||
success, message = end_lottery_session()
|
||||
return {"message": message} if success else {"error": message}
|
||||
|
@ -17,7 +17,7 @@ def lottery_end(v):
|
|||
|
||||
@app.post("/lottery/start")
|
||||
@admin_level_required(3)
|
||||
@lottery_required
|
||||
@casino_required
|
||||
def lottery_start(v):
|
||||
start_new_lottery_session()
|
||||
return {"message": "Lottery started."}
|
||||
|
@ -26,7 +26,7 @@ def lottery_start(v):
|
|||
@app.post("/lottery/buy")
|
||||
@limiter.limit("3/second;100/minute;500/hour;1000/day")
|
||||
@auth_required
|
||||
@lottery_required
|
||||
@casino_required
|
||||
def lottery_buy(v):
|
||||
try: quantity = int(request.values.get("quantity"))
|
||||
except: return {"error": "Invalid ticket quantity."}
|
||||
|
@ -44,7 +44,7 @@ def lottery_buy(v):
|
|||
@app.get("/lottery/active")
|
||||
@limiter.limit("3/second;100/minute;500/hour;1000/day")
|
||||
@auth_required
|
||||
@lottery_required
|
||||
@casino_required
|
||||
def lottery_active(v):
|
||||
lottery, participants = get_active_lottery_stats()
|
||||
|
||||
|
@ -52,7 +52,7 @@ def lottery_active(v):
|
|||
|
||||
@app.get("/admin/lottery/participants")
|
||||
@admin_level_required(2)
|
||||
@lottery_required
|
||||
@casino_required
|
||||
def lottery_admin(v):
|
||||
participants = get_users_participating_in_lottery()
|
||||
return render_template("admin/lottery.html", v=v, participants=participants)
|
||||
|
|
Loading…
Reference in New Issue