From b2d1f3b14c14466c8aaa1381220c1477ec132121 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 10 Aug 2023 18:07:36 +0700 Subject: [PATCH] 11508 clear user groups --- netbox/netbox/authentication.py | 1 + 1 file changed, 1 insertion(+) diff --git a/netbox/netbox/authentication.py b/netbox/netbox/authentication.py index 590517231..ba2573b72 100644 --- a/netbox/netbox/authentication.py +++ b/netbox/netbox/authentication.py @@ -440,6 +440,7 @@ def azuread_map_groups(response, user, backend, *args, **kwargs): is_staff = False values = response.json().get('value', []) + user.groups.clear() for value in values: # AD response contains both directories and groups - we only want groups if value.get('@odata.type') == '#microsoft.graph.group':