diff --git a/dd-sso/admin/src/admin/lib/keycloak_client.py b/dd-sso/admin/src/admin/lib/keycloak_client.py index 44b9be2..75af0ba 100644 --- a/dd-sso/admin/src/admin/lib/keycloak_client.py +++ b/dd-sso/admin/src/admin/lib/keycloak_client.py @@ -321,9 +321,10 @@ class KeycloakClient: def add_group(self, name : str, parent : str="", skip_exists : bool=False) -> Any: self.connect() + parentId : Optional[str] = None if parent: - parent = self.get_group_by_path(parent)["id"] - return self.keycloak_admin.create_group({"name": name}, parent=parent) + parentId = self.get_group_by_path(parent)["id"] + return self.keycloak_admin.create_group({"name": name}, parent=parentId) def delete_group(self, group_id : str) -> Any: self.connect()