fix: change return type

This commit is contained in:
dettlaff 2024-11-11 21:09:14 +04:00
parent 997b88d4c8
commit 0f92452ee8

View file

@ -31,15 +31,16 @@ class KanidmUserRepository(AbstractUserRepository):
"Content-Type": "application/json", "Content-Type": "application/json",
}, },
timeout=0.8, # TODO: change timeout timeout=0.8, # TODO: change timeout
verify=False, verify=False, # TODO: REMOVE THIS NOTHALAL!!!!!
) )
if response.status_code != 200: if response.status_code != 200:
raise KanidmQueryError( raise KanidmQueryError(
f"Kanidm returned {response.status_code} unexpected HTTP status code. Endpoint: {full_endpoint}. Error: {response.text}." f"Kanidm returned {response.status_code} unexpected HTTP status code. Endpoint: {full_endpoint}. Error: {response.text}."
) )
json = response.json() # json = response.json()
return json["data"] # return json["data"]
return response.json()
except Exception as error: except Exception as error:
raise KanidmQueryError(f"Kanidm request failed! Error: {str(error)}") raise KanidmQueryError(f"Kanidm request failed! Error: {str(error)}")