fix: if OR in _check_response_type_and_not_empty

This commit is contained in:
dettlaff 2024-12-13 18:08:59 +04:00
parent bcc8e51eb0
commit e5268ba6b5

View file

@ -188,7 +188,7 @@ class KanidmUserRepository(AbstractUserRepository):
KanidmReturnUnknownResponseType: If the response data is not of the expected type. KanidmReturnUnknownResponseType: If the response data is not of the expected type.
""" """
if not response_data and response_data is None: if not response_data or response_data is None:
raise KanidmReturnEmptyResponse raise KanidmReturnEmptyResponse
if data_type == "list": if data_type == "list":
@ -523,6 +523,19 @@ class KanidmUserRepository(AbstractUserRepository):
@staticmethod @staticmethod
def get_groups() -> list[Group]: def get_groups() -> list[Group]:
"""
Return Kanidm groups.
! Not implemented in JsonUserRepository !
Returns:
list[Group]
Raises:
KanidmReturnEmptyResponse: If the response from Kanidm is empty.
KanidmQueryError: If an error occurs while generating the link.
KanidmReturnUnknownResponseType: If response type is unknown.
"""
groups_list_data = KanidmUserRepository._send_query( groups_list_data = KanidmUserRepository._send_query(
endpoint="group", endpoint="group",
method="GET", method="GET",