mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Clean up backup configs when deleting servers
This commit is contained in:
parent
2706ffddbe
commit
c58e4e3ebf
@ -134,8 +134,13 @@ class ServersController(metaclass=Singleton):
|
||||
role_id = role.role_id
|
||||
role_data = RolesController.get_role_with_servers(role_id)
|
||||
role_data["servers"] = {server_id}
|
||||
# Remove server id permissions from role
|
||||
PermissionsServers.delete_roles_permissions(role_id, role_data["servers"])
|
||||
# Remove roles from server
|
||||
PermissionsServers.remove_roles_of_server(server_id)
|
||||
# Remove backup configs tied to server
|
||||
self.management_helper.remove_backup_config(server_id)
|
||||
# Finally remove server
|
||||
self.servers_helper.remove_server(server_id)
|
||||
|
||||
@staticmethod
|
||||
|
@ -367,6 +367,10 @@ class HelpersManagement:
|
||||
}
|
||||
return conf
|
||||
|
||||
@staticmethod
|
||||
def remove_backup_config(server_id):
|
||||
Backups.delete().where(Backups.server_id == server_id).execute()
|
||||
|
||||
def set_backup_config(
|
||||
self,
|
||||
server_id: int,
|
||||
|
Loading…
Reference in New Issue
Block a user