From 6204bf92b0b592668b58b3b193248f628d6b089f Mon Sep 17 00:00:00 2001 From: Martin Devlin Date: Thu, 20 Sep 2018 12:04:53 +0100 Subject: [PATCH 1/2] Fix a bug in the subgroup searching --- keycloak/keycloak_admin.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/keycloak/keycloak_admin.py b/keycloak/keycloak_admin.py index fce82ef..e1d4502 100644 --- a/keycloak/keycloak_admin.py +++ b/keycloak/keycloak_admin.py @@ -413,10 +413,13 @@ class KeycloakAdmin: if group['path'] == path: return group elif search_in_subgroups and group["subGroups"]: - res = self.get_subgroups(group, path) - if res != None: - return res - return None + for group in group["subGroups"]: + if group['path'] == path: + return group + res = self.get_subgroups(group, path) + if res != None: + return res + return None def create_group(self, payload, parent=None, skip_exists=False): """ From f635420b67ce2594fccadf81c062ee9df9440ea4 Mon Sep 17 00:00:00 2001 From: Martin Devlin Date: Thu, 20 Sep 2018 14:36:48 +0100 Subject: [PATCH 2/2] Fix tab --- keycloak/keycloak_admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keycloak/keycloak_admin.py b/keycloak/keycloak_admin.py index e1d4502..13ae472 100644 --- a/keycloak/keycloak_admin.py +++ b/keycloak/keycloak_admin.py @@ -419,7 +419,7 @@ class KeycloakAdmin: res = self.get_subgroups(group, path) if res != None: return res - return None + return None def create_group(self, payload, parent=None, skip_exists=False): """