From 273aec2321ec4731bbdb7eca762ec1b36a59118b Mon Sep 17 00:00:00 2001 From: Max Rink Date: Tue, 9 Feb 2021 10:35:36 +0100 Subject: [PATCH] fix incorrect assumption about when to run the group sync --- netbox/netbox/authentication.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netbox/netbox/authentication.py b/netbox/netbox/authentication.py index 2bd15f08e..17b9eefd6 100644 --- a/netbox/netbox/authentication.py +++ b/netbox/netbox/authentication.py @@ -153,9 +153,11 @@ class RemoteUserBackend(_RemoteUserBackend): except UserModel.DoesNotExist: pass if self.user_can_authenticate(user): - if remote_groups: + if settings.REMOTE_AUTH_GROUP_SYNC_ENABLED: if user is not None and not isinstance(user, AnonymousUser): return self.configure_groups(user,remote_groups) + else: + return user else: return None