mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-02-18 23:34:31 +00:00
fix: kanidm error check
This commit is contained in:
parent
3bf4cafb0a
commit
752f887f00
1 changed files with 3 additions and 2 deletions
|
@ -156,8 +156,9 @@ class KanidmUserRepository(AbstractUserRepository):
|
|||
response = response.json()
|
||||
|
||||
if response and response != []:
|
||||
if response[0]["plugin"].get("attrunique") == "duplicate value detected":
|
||||
raise UserAlreadyExists # TODO only user?
|
||||
if response[0].get("plugin"):
|
||||
if response[0]["plugin"].get("attrunique") == "duplicate value detected":
|
||||
raise UserAlreadyExists # TODO only user?
|
||||
else:
|
||||
raise KanidmReturnEmptyResponse
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue