fix a bug that breaks OPT_X_TLS_REQUIRE_CERT=0 for LDAP authentication

This commit is contained in:
Ryan Petrello 2019-07-05 10:21:25 -04:00
parent d4f50896de
commit 0dcbafaccb
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -66,7 +66,7 @@ class LDAPSettings(BaseLDAPSettings):
# see: https://github.com/python-ldap/python-ldap/issues/55
newctx_option = self.CONNECTION_OPTIONS.pop(ldap.OPT_X_TLS_NEWCTX, None)
self.CONNECTION_OPTIONS = OrderedDict(self.CONNECTION_OPTIONS)
if newctx_option:
if newctx_option is not None:
self.CONNECTION_OPTIONS[ldap.OPT_X_TLS_NEWCTX] = newctx_option