diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6e57a76..36025eb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,12 @@ Added ----- * Dutch translation +Fixed +----- +* Then using the LDAP auth backend with ``bind`` method for password check, do not try to bind + if the user dn was not found. This was causing the exception + ``'NoneType' object has no attribute 'getitem'`` describe in #21 + v0.8.0 - 2017-03-08 =================== diff --git a/cas_server/auth.py b/cas_server/auth.py index bcdce71..9a0893e 100644 --- a/cas_server/auth.py +++ b/cas_server/auth.py @@ -321,7 +321,7 @@ class LdapAuthUser(DBAuthUser): # pragma: no cover correct, ``False`` otherwise. :rtype: bool """ - if settings.CAS_LDAP_PASSWORD_CHECK == "bind": + if self.user and settings.CAS_LDAP_PASSWORD_CHECK == "bind": try: conn = ldap3.Connection( settings.CAS_LDAP_SERVER,