[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
mejoras_instalacion
Evilham 2022-08-29 12:22:58 +02:00
parent 3f08973d7c
commit 2d057ec6bc
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
1 changed files with 3 additions and 2 deletions

View File

@ -321,9 +321,10 @@ class KeycloakClient:
def add_group(self, name : str, parent : str="", skip_exists : bool=False) -> Any: def add_group(self, name : str, parent : str="", skip_exists : bool=False) -> Any:
self.connect() self.connect()
parentId : Optional[str] = None
if parent: if parent:
parent = self.get_group_by_path(parent)["id"] parentId = self.get_group_by_path(parent)["id"]
return self.keycloak_admin.create_group({"name": name}, parent=parent) return self.keycloak_admin.create_group({"name": name}, parent=parentId)
def delete_group(self, group_id : str) -> Any: def delete_group(self, group_id : str) -> Any:
self.connect() self.connect()