mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 12:46:39 +00:00
fix: if OR in _check_response_type_and_not_empty
This commit is contained in:
parent
bcc8e51eb0
commit
e5268ba6b5
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue