From e6b1eef4c25d864cde839a8327c3be4403e2762c Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sat, 2 Apr 2022 02:58:31 +0100 Subject: [PATCH] Remove more unnecessary singleton lint exemptions If testing truthy/falsy we should be using is --- app/classes/models/server_permissions.py | 3 +-- app/classes/models/servers.py | 3 +-- app/classes/models/users.py | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/classes/models/server_permissions.py b/app/classes/models/server_permissions.py index 92ecbd09..73955bae 100644 --- a/app/classes/models/server_permissions.py +++ b/app/classes/models/server_permissions.py @@ -227,8 +227,7 @@ class Permissions_Servers: def get_server_user_list(server_id): final_users = [] server_roles = Role_Servers.select().where(Role_Servers.server_id == server_id) - # pylint: disable=singleton-comparison - super_users = Users.select().where(Users.superuser == True) + super_users = Users.select().where(Users.superuser is True) for role in server_roles: users = User_Roles.select().where(User_Roles.role_id == role.role_id) for user in users: diff --git a/app/classes/models/servers.py b/app/classes/models/servers.py index f9c777a1..f00704fe 100644 --- a/app/classes/models/servers.py +++ b/app/classes/models/servers.py @@ -260,8 +260,7 @@ class helper_servers: @staticmethod def is_crashed(server_id): svr = Server_Stats.select().where(Server_Stats.server_id == server_id).get() - # pylint: disable=singleton-comparison - if svr.crashed == True: + if svr.crashed is True: return True else: return False diff --git a/app/classes/models/users.py b/app/classes/models/users.py index dbe189c7..dae72480 100644 --- a/app/classes/models/users.py +++ b/app/classes/models/users.py @@ -221,8 +221,7 @@ class helper_users: @staticmethod def get_super_user_list(): final_users = [] - # pylint: disable=singleton-comparison - super_users = Users.select().where(Users.superuser == True) + super_users = Users.select().where(Users.superuser is True) for suser in super_users: if suser.user_id not in final_users: final_users.append(suser.user_id) @@ -251,8 +250,7 @@ class helper_users: @staticmethod def clear_support_status(): - # pylint: disable=singleton-comparison - Users.update(preparing=False).where(Users.preparing == True).execute() + Users.update(preparing=False).where(Users.preparing is True).execute() @staticmethod def user_id_exists(user_id):