Browse Source

fix: allow exception to be thrown if role does not exist (i.e. 404) and skip exist is true

pull/317/head
Jackson Kwok 3 years ago
parent
commit
67e61625c0
No known key found for this signature in database GPG Key ID: BB88FE9481A0273D
  1. 6
      keycloak/keycloak_admin.py

6
keycloak/keycloak_admin.py

@ -1361,9 +1361,13 @@ class KeycloakAdmin:
""" """
if skip_exists: if skip_exists:
try:
res = self.get_client_role(client_id=client_role_id, role_name=payload["name"]) res = self.get_client_role(client_id=client_role_id, role_name=payload["name"])
except:
pass
else:
if res: if res:
return res["name"]
return res['name']
params_path = {"realm-name": self.realm_name, "id": client_role_id} params_path = {"realm-name": self.realm_name, "id": client_role_id}
data_raw = self.raw_post( data_raw = self.raw_post(

Loading…
Cancel
Save