Loading portal/rest/roles.py +7 −3 Original line number Diff line number Diff line Loading @@ -134,9 +134,13 @@ class RoleUsersList(CustomResource): # authorization log.debug(f"[REST] Get role clients in {role.log_name} by {self.client.log_name}") self.permissions(course=course).require.belongs_to_role(role) users = [client for client in role.clients if client.type == ClientType[type.upper()]] return SCHEMAS.dump('users', users) schema_type = 'clients' clients = role.clients if type and type in ['user', 'worker']: schema_type = f'{type}s' clients = [client for client in role.clients if client.type == ClientType[type.upper()]] return SCHEMAS.dump(schema_type, clients) @jwt_required @access_log Loading Loading
portal/rest/roles.py +7 −3 Original line number Diff line number Diff line Loading @@ -134,9 +134,13 @@ class RoleUsersList(CustomResource): # authorization log.debug(f"[REST] Get role clients in {role.log_name} by {self.client.log_name}") self.permissions(course=course).require.belongs_to_role(role) users = [client for client in role.clients if client.type == ClientType[type.upper()]] return SCHEMAS.dump('users', users) schema_type = 'clients' clients = role.clients if type and type in ['user', 'worker']: schema_type = f'{type}s' clients = [client for client in role.clients if client.type == ClientType[type.upper()]] return SCHEMAS.dump(schema_type, clients) @jwt_required @access_log Loading