1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-01-24 12:47:05 +00:00

Fixed SIM103 (needless-bool): Return the condition not "admin" not in privs directly

This commit is contained in:
Teal Dulcet 2025-01-08 05:11:04 -08:00
parent 5aded07843
commit c75be2f8d2

View File

@ -664,8 +664,7 @@ def check_request_cookie_for_admin_access():
if not session: return False if not session: return False
privs = get_mail_user_privileges(session["email"], env) privs = get_mail_user_privileges(session["email"], env)
if not isinstance(privs, list): return False if not isinstance(privs, list): return False
if "admin" not in privs: return False return "admin" in privs
return True
def authorized_personnel_only_via_cookie(f): def authorized_personnel_only_via_cookie(f):
@wraps(f) @wraps(f)