Fixing role edit in case creating role before server

This commit is contained in:
Silversthorn 2021-09-29 21:40:56 +02:00
parent f5ae4d02ff
commit 5a0789faa5

View File

@ -124,8 +124,9 @@ class Permissions_Servers:
@staticmethod
def get_role_permissions_list(role_id):
permissions_mask = ''
role_server = Role_Servers.select().where(Role_Servers.role_id == role_id).execute()
permissions_mask = '00000000'
role_server = Role_Servers.get_or_none(role_id)# select().where(Role_Servers.role_id == role_id).execute()
if role_server is not None:
permissions_mask = role_server[0].permissions
permissions_list = server_permissions.get_permissions(permissions_mask)
return permissions_list