mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-31 05:06:41 +00:00
fix: try to except kanidm errors
This commit is contained in:
parent
51a663bc0a
commit
d4dada174a
|
@ -155,7 +155,7 @@ class KanidmUserRepository(AbstractUserRepository):
|
||||||
|
|
||||||
response = response.json()
|
response = response.json()
|
||||||
|
|
||||||
if response.get("plugin"):
|
if response["plugin"]:
|
||||||
if response["plugin"].get("attrunique") == "duplicate value detected":
|
if response["plugin"].get("attrunique") == "duplicate value detected":
|
||||||
raise UserAlreadyExists # TODO only user?
|
raise UserAlreadyExists # TODO only user?
|
||||||
|
|
||||||
|
@ -165,6 +165,7 @@ class KanidmUserRepository(AbstractUserRepository):
|
||||||
raise KanidmQueryError(f"Kanidm request failed! Error: {str(error)}")
|
raise KanidmQueryError(f"Kanidm request failed! Error: {str(error)}")
|
||||||
|
|
||||||
# {"plugin": {"attrunique": "duplicate value detected"}}
|
# {"plugin": {"attrunique": "duplicate value detected"}}
|
||||||
|
# nomatchingentries
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def create_user(
|
def create_user(
|
||||||
|
|
Loading…
Reference in a new issue