mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Revert Singleton testing operators on db querys
These are not compatible with peewee querys, see MR !233 for details
This commit is contained in:
parent
e6b1eef4c2
commit
23ecef6826
@ -322,7 +322,11 @@ class helpers_management:
|
||||
|
||||
@staticmethod
|
||||
def get_schedules_enabled():
|
||||
return Schedules.select().where(Schedules.enabled is True).execute()
|
||||
return (
|
||||
Schedules.select()
|
||||
.where(Schedules.enabled == True) # pylint: disable=singleton-comparison
|
||||
.execute()
|
||||
)
|
||||
|
||||
# **********************************************************************************
|
||||
# Backups Methods
|
||||
@ -435,7 +439,7 @@ class helpers_management:
|
||||
@staticmethod
|
||||
def clear_unexecuted_commands():
|
||||
Commands.update({Commands.executed: True}).where(
|
||||
Commands.executed is False
|
||||
Commands.executed == False # pylint: disable=singleton-comparison
|
||||
).execute()
|
||||
|
||||
|
||||
|
@ -227,7 +227,9 @@ class Permissions_Servers:
|
||||
def get_server_user_list(server_id):
|
||||
final_users = []
|
||||
server_roles = Role_Servers.select().where(Role_Servers.server_id == server_id)
|
||||
super_users = Users.select().where(Users.superuser is True)
|
||||
super_users = Users.select().where(
|
||||
Users.superuser == True # pylint: disable=singleton-comparison
|
||||
)
|
||||
for role in server_roles:
|
||||
users = User_Roles.select().where(User_Roles.role_id == role.role_id)
|
||||
for user in users:
|
||||
|
@ -221,7 +221,9 @@ class helper_users:
|
||||
@staticmethod
|
||||
def get_super_user_list():
|
||||
final_users = []
|
||||
super_users = Users.select().where(Users.superuser is True)
|
||||
super_users = Users.select().where(
|
||||
Users.superuser == True # pylint: disable=singleton-comparison
|
||||
)
|
||||
for suser in super_users:
|
||||
if suser.user_id not in final_users:
|
||||
final_users.append(suser.user_id)
|
||||
@ -250,7 +252,9 @@ class helper_users:
|
||||
|
||||
@staticmethod
|
||||
def clear_support_status():
|
||||
Users.update(preparing=False).where(Users.preparing is True).execute()
|
||||
Users.update(preparing=False).where(
|
||||
Users.preparing == True # pylint: disable=singleton-comparison
|
||||
).execute()
|
||||
|
||||
@staticmethod
|
||||
def user_id_exists(user_id):
|
||||
|
Loading…
Reference in New Issue
Block a user