mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Remove more unnecessary singleton lint exemptions
If testing truthy/falsy we should be using is
This commit is contained in:
parent
db70f9ae20
commit
e6b1eef4c2
@ -227,8 +227,7 @@ class Permissions_Servers:
|
|||||||
def get_server_user_list(server_id):
|
def get_server_user_list(server_id):
|
||||||
final_users = []
|
final_users = []
|
||||||
server_roles = Role_Servers.select().where(Role_Servers.server_id == server_id)
|
server_roles = Role_Servers.select().where(Role_Servers.server_id == server_id)
|
||||||
# pylint: disable=singleton-comparison
|
super_users = Users.select().where(Users.superuser is True)
|
||||||
super_users = Users.select().where(Users.superuser == True)
|
|
||||||
for role in server_roles:
|
for role in server_roles:
|
||||||
users = User_Roles.select().where(User_Roles.role_id == role.role_id)
|
users = User_Roles.select().where(User_Roles.role_id == role.role_id)
|
||||||
for user in users:
|
for user in users:
|
||||||
|
@ -260,8 +260,7 @@ class helper_servers:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def is_crashed(server_id):
|
def is_crashed(server_id):
|
||||||
svr = Server_Stats.select().where(Server_Stats.server_id == server_id).get()
|
svr = Server_Stats.select().where(Server_Stats.server_id == server_id).get()
|
||||||
# pylint: disable=singleton-comparison
|
if svr.crashed is True:
|
||||||
if svr.crashed == True:
|
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
@ -221,8 +221,7 @@ class helper_users:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def get_super_user_list():
|
def get_super_user_list():
|
||||||
final_users = []
|
final_users = []
|
||||||
# pylint: disable=singleton-comparison
|
super_users = Users.select().where(Users.superuser is True)
|
||||||
super_users = Users.select().where(Users.superuser == True)
|
|
||||||
for suser in super_users:
|
for suser in super_users:
|
||||||
if suser.user_id not in final_users:
|
if suser.user_id not in final_users:
|
||||||
final_users.append(suser.user_id)
|
final_users.append(suser.user_id)
|
||||||
@ -251,8 +250,7 @@ class helper_users:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def clear_support_status():
|
def clear_support_status():
|
||||||
# pylint: disable=singleton-comparison
|
Users.update(preparing=False).where(Users.preparing is True).execute()
|
||||||
Users.update(preparing=False).where(Users.preparing == True).execute()
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def user_id_exists(user_id):
|
def user_id_exists(user_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user