From 2d057ec6bc878091fcb1d1af6117001d533e858e Mon Sep 17 00:00:00 2001 From: Evilham Date: Mon, 29 Aug 2022 12:22:58 +0200 Subject: [PATCH] [sso-admin] Fix regression on new installations When introducing typing, we erroneously started passing an empty parent Id instead of None, and the underlying Keycloak library failed to create the groups. Closes #15 --- dd-sso/admin/src/admin/lib/keycloak_client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()