Fixed an issue where if LDAP_SEARCH_BASE_DN is not set then, the value for LDAP_BASE_DN will be considered. Fixes #5487

This commit is contained in:
Khushboo Vashi
2020-05-18 12:35:34 +05:30
committed by Akshay Joshi
parent 9f445dc052
commit d1bdb178e2
3 changed files with 12 additions and 5 deletions

View File

@@ -158,7 +158,8 @@ class LDAPAuthentication(BaseAuthentication):
search criteria."""
try:
search_base_dn = config.LDAP_SEARCH_BASE_DN
if search_base_dn is None or search_base_dn == '':
if search_base_dn is None or search_base_dn == '' or\
search_base_dn == '<Search-Base-DN>':
search_base_dn = config.LDAP_BASE_DN
self.conn.search(search_base=search_base_dn,
search_filter=config.LDAP_SEARCH_FILTER,