Browse Source

Fixed create group.

hotfix/merge
Marcos Pereira 5 years ago
parent
commit
ef5a316820
  1. 13
      keycloak/keycloak_admin.py

13
keycloak/keycloak_admin.py

@ -511,18 +511,6 @@ class KeycloakAdmin:
:return: Http response :return: Http response
""" """
name = payload['name']
path = payload['path']
exists = None
if name is None and path is not None:
path = "/" + name
elif path is not None:
exists = self.get_group_by_path(path=path, search_in_subgroups=True)
if exists is not None:
return str(exists)
if parent is None: if parent is None:
params_path = {"realm-name": self.realm_name} params_path = {"realm-name": self.realm_name}
@ -532,6 +520,7 @@ class KeycloakAdmin:
params_path = {"realm-name": self.realm_name, "id": parent, } params_path = {"realm-name": self.realm_name, "id": parent, }
data_raw = self.connection.raw_post(URL_ADMIN_GROUP_CHILD.format(**params_path), data_raw = self.connection.raw_post(URL_ADMIN_GROUP_CHILD.format(**params_path),
data=json.dumps(payload)) data=json.dumps(payload))
return raise_error_from_response(data_raw, KeycloakGetError, expected_code=201, skip_exists=skip_exists) return raise_error_from_response(data_raw, KeycloakGetError, expected_code=201, skip_exists=skip_exists)
def update_group(self, group_id, payload): def update_group(self, group_id, payload):

Loading…
Cancel
Save