Do not try to bind if the user dn was not found with LDAP auth backend
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
This commit is contained in:
parent
4c15b51612
commit
443c87fa40
@ -14,6 +14,12 @@ Added
|
|||||||
-----
|
-----
|
||||||
* Dutch translation
|
* 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
|
v0.8.0 - 2017-03-08
|
||||||
===================
|
===================
|
||||||
|
@ -321,7 +321,7 @@ class LdapAuthUser(DBAuthUser): # pragma: no cover
|
|||||||
correct, ``False`` otherwise.
|
correct, ``False`` otherwise.
|
||||||
:rtype: bool
|
:rtype: bool
|
||||||
"""
|
"""
|
||||||
if settings.CAS_LDAP_PASSWORD_CHECK == "bind":
|
if self.user and settings.CAS_LDAP_PASSWORD_CHECK == "bind":
|
||||||
try:
|
try:
|
||||||
conn = ldap3.Connection(
|
conn = ldap3.Connection(
|
||||||
settings.CAS_LDAP_SERVER,
|
settings.CAS_LDAP_SERVER,
|
||||||
|
Loading…
Reference in New Issue
Block a user