mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 20:56:39 +00:00
feat: add response_data == "nomatchingentries"
This commit is contained in:
parent
eca12a3079
commit
33f491d4f6
|
@ -11,7 +11,7 @@ class UserIsProtected(Exception):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_error_message() -> str:
|
def get_error_message() -> str:
|
||||||
return "User is protected and cannot be deleted"
|
return "User is protected and cannot be deleted or modified"
|
||||||
|
|
||||||
|
|
||||||
class UsernameForbidden(Exception):
|
class UsernameForbidden(Exception):
|
||||||
|
|
|
@ -166,6 +166,9 @@ class KanidmUserRepository(AbstractUserRepository):
|
||||||
if plugin_error.get("attrunique") == "duplicate value detected":
|
if plugin_error.get("attrunique") == "duplicate value detected":
|
||||||
raise UserAlreadyExists # TODO only user ?
|
raise UserAlreadyExists # TODO only user ?
|
||||||
|
|
||||||
|
if isinstance(response_data, str) and response_data == "nomatchingentries":
|
||||||
|
raise UserNotFound # is it works only for user?
|
||||||
|
|
||||||
raise KanidmQueryError(error_text=response.text)
|
raise KanidmQueryError(error_text=response.text)
|
||||||
|
|
||||||
return response_data
|
return response_data
|
||||||
|
|
Loading…
Reference in a new issue