Simplify getting LDAP_USE_TLS

This commit is contained in:
PCoder 2019-02-17 17:57:48 +01:00
parent 1673d6e03b
commit 8b61db8dee

View file

@ -28,8 +28,7 @@ search_base = os.environ['LDAPSEARCH'].split()
search_base_ldap = [ LDAPSearch(x, ldap.SCOPE_SUBTREE, "(uid=%(user)s)") for x in search_base ] search_base_ldap = [ LDAPSearch(x, ldap.SCOPE_SUBTREE, "(uid=%(user)s)") for x in search_base ]
AUTH_LDAP_USER_SEARCH = LDAPSearchUnion(*search_base_ldap) AUTH_LDAP_USER_SEARCH = LDAPSearchUnion(*search_base_ldap)
if os.environ['LDAP_USE_TLS']: AUTH_LDAP_START_TLS = os.environ.get('LDAP_USE_TLS', False)
AUTH_LDAP_START_TLS=True
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))