From 87ae34966b4590f85eb847c2dd19cfa615cf8c0b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 30 Nov 2022 23:15:07 +0200 Subject: [PATCH] badge perm shit --- files/helpers/const.py | 2 +- files/routes/admin.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index a2023a3b0..ea0fb8a39 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -490,7 +490,7 @@ TIERS_ID_TO_NAME = { 6: "Rich Bich", } -BADGE_BLACKLIST = { # only grantable by AEVANN_ID except on PCM +BADGE_BLACKLIST = { # only grantable by AEVANN_ID and SNAKES_ID except on PCM 16, 17, 21, 22, 23, 24, 25, 26, 27, # Marsey Artist x2 / Patron Tiers 94, 95, 96, 97, 98, 109, 67, 68, 83, 84, 87, 90, 140, 179, 185, # Award Status 137, # Lottery Winner diff --git a/files/routes/admin.py b/files/routes/admin.py index b1727353d..e68d343b7 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -512,10 +512,13 @@ def under_attack(v): def admin_badges_grantable_list(v): query = g.db.query(BadgeDef) - if BADGE_BLACKLIST and v.id != AEVANN_ID and SITE != 'pcmemes.net': - query = query.filter(BadgeDef.id.notin_(BADGE_BLACKLIST)) - if BADGE_WHITELIST: - query = query.filter(BadgeDef.id.in_(BADGE_WHITELIST)) + + if v.id not in {AEVANN_ID, SNAKES_ID} and SITE != 'pcmemes.net': + if BADGE_BLACKLIST: + query = query.filter(BadgeDef.id.notin_(BADGE_BLACKLIST)) + elif BADGE_WHITELIST and v.id != CARP_ID: + query = query.filter(BadgeDef.id.in_(BADGE_WHITELIST)) + badge_types = query.order_by(BadgeDef.id).all() return badge_types