From c75be2f8d26c59fca658629bd01ebbc2cb6e5b6b Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Wed, 8 Jan 2025 05:11:04 -0800 Subject: [PATCH] Fixed SIM103 (needless-bool): Return the condition `not "admin" not in privs` directly --- management/daemon.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/management/daemon.py b/management/daemon.py index dd1cc89a..14fc5d9f 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -664,8 +664,7 @@ def check_request_cookie_for_admin_access(): if not session: return False privs = get_mail_user_privileges(session["email"], env) if not isinstance(privs, list): return False - if "admin" not in privs: return False - return True + return "admin" in privs def authorized_personnel_only_via_cookie(f): @wraps(f)