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
No known key found for this signature in database
GPG Key ID: BB88FE9481A0273D
1 changed files with
7 additions and
3 deletions
-
keycloak/keycloak_admin.py
|
|
@ -1361,9 +1361,13 @@ class KeycloakAdmin: |
|
|
|
""" |
|
|
|
|
|
|
|
if skip_exists: |
|
|
|
res = self.get_client_role(client_id=client_role_id, role_name=payload["name"]) |
|
|
|
if res: |
|
|
|
return res["name"] |
|
|
|
try: |
|
|
|
res = self.get_client_role(client_id=client_role_id, role_name=payload["name"]) |
|
|
|
except: |
|
|
|
pass |
|
|
|
else: |
|
|
|
if res: |
|
|
|
return res['name'] |
|
|
|
|
|
|
|
params_path = {"realm-name": self.realm_name, "id": client_role_id} |
|
|
|
data_raw = self.raw_post( |
|
|
|