From 6911101e290eadbf9a1cd80f5967f719912ec683 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 5 Oct 2022 22:59:27 -0700 Subject: [PATCH] post bet distributions --- files/classes/submission.py | 2 +- files/helpers/const.py | 1 + files/routes/admin.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index fb7c81a52..1e0816c4e 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -377,7 +377,7 @@ class Submission(Base): if o.exclusive == 3: body += " - WINNER!" - if not winner and v and v.admin_level > 2: + if not winner and v and v.admin_level >= PERMS['POST_BETS_DISTRIBUTE']: body += f'''''' body += "" else: diff --git a/files/helpers/const.py b/files/helpers/const.py index d29b4e925..548f96a90 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -141,6 +141,7 @@ PERMS = { # Minimum admin_level to perform action. 'POST_TO_CHANGELOG': 1, 'POST_TO_POLL_THREAD': 2, 'POST_BETS': 3, + 'POST_BETS_DISTRIBUTE': 3, # probably should be the same as POST_BETS but w/e 'BYPASS_PIN_LIMIT': 3, 'VIEW_PENDING_SUBMITTED_MARSEYS': 3, 'VIEW_PENDING_SUBMITTED_HATS': 3, diff --git a/files/routes/admin.py b/files/routes/admin.py index 642394a71..385476cfc 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -193,7 +193,7 @@ def remove_admin(v, username): @app.post("/distribute/") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@admin_level_required(3) +@admin_level_required(PERMS['POST_BETS_DISTRIBUTE']) def distribute(v, option_id): autojanny = get_account(AUTOJANNY_ID) if autojanny.coins == 0: return {"error": "@AutoJanny has 0 coins"}, 400