From 22186b267daef78c679a4dc2ae2ef2d9865fc131 Mon Sep 17 00:00:00 2001 From: ryanmerolle Date: Mon, 22 Feb 2021 15:55:40 -0500 Subject: [PATCH] do not set AUTH_LDAP_MIRROR_GROUPS if not defined --- configuration/ldap/ldap_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configuration/ldap/ldap_config.py b/configuration/ldap/ldap_config.py index 3071b45..f316ac0 100644 --- a/configuration/ldap/ldap_config.py +++ b/configuration/ldap/ldap_config.py @@ -77,7 +77,8 @@ if AUTH_LDAP_REQUIRE_GROUP is not None: # For more granular permissions, we can map LDAP groups to Django groups. AUTH_LDAP_FIND_GROUP_PERMS = environ.get('AUTH_LDAP_FIND_GROUP_PERMS', 'True').lower() == 'true' -AUTH_LDAP_MIRROR_GROUPS = environ.get('AUTH_LDAP_MIRROR_GROUPS', '').lower() == 'true' +if environ.get('AUTH_LDAP_MIRROR_GROUPS') is not None: + AUTH_LDAP_MIRROR_GROUPS = environ.get('AUTH_LDAP_MIRROR_GROUPS', '').lower() == 'true' # Cache groups for one hour to reduce LDAP traffic AUTH_LDAP_CACHE_TIMEOUT = int(environ.get('AUTH_LDAP_CACHE_TIMEOUT', 3600))