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