diff --git a/app/classes/models/management.py b/app/classes/models/management.py index a95698ca..8c6a49a6 100644 --- a/app/classes/models/management.py +++ b/app/classes/models/management.py @@ -264,8 +264,7 @@ class HelpersManagement: @staticmethod def delete_scheduled_task(schedule_id): - sch = Schedules.get(Schedules.schedule_id == schedule_id) - return Schedules.delete_instance(sch) + return Schedules.delete().where(Schedules.schedule_id == schedule_id).execute() @staticmethod def update_scheduled_task(schedule_id, updates): diff --git a/app/classes/models/roles.py b/app/classes/models/roles.py index 009aceb5..4e2325b8 100644 --- a/app/classes/models/roles.py +++ b/app/classes/models/roles.py @@ -64,9 +64,7 @@ class HelperRoles: return Roles.update(up_data).where(Roles.role_id == role_id).execute() def remove_role(self, role_id): - with self.database.atomic(): - role = Roles.get(Roles.role_id == role_id) - return role.delete_instance() + return Roles.delete().where(Roles.role_id == role_id).execute() @staticmethod def role_id_exists(role_id): diff --git a/app/classes/models/servers.py b/app/classes/models/servers.py index 8527b52e..8590d73e 100644 --- a/app/classes/models/servers.py +++ b/app/classes/models/servers.py @@ -128,8 +128,7 @@ class HelperServers: return server_obj.save() def remove_server(self, server_id): - with self.database.atomic(): - Servers.delete().where(Servers.server_id == server_id).execute() + Servers.delete().where(Servers.server_id == server_id).execute() @staticmethod def get_server_data_by_id(server_id): diff --git a/app/classes/models/users.py b/app/classes/models/users.py index 59a9169e..c2295290 100644 --- a/app/classes/models/users.py +++ b/app/classes/models/users.py @@ -224,8 +224,7 @@ class HelperUsers: def remove_user(self, user_id): with self.database.atomic(): UserRoles.delete().where(UserRoles.user_id == user_id).execute() - user = Users.get(Users.user_id == user_id) - return user.delete_instance() + Users.delete().where(Users.user_id == user_id).execute() @staticmethod def set_support_path(user_id, support_path):