Explorar o código

Catch all LDAP exceptions

Guillaume Ayoub %!s(int64=15) %!d(string=hai) anos
pai
achega
f39d90caa9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      radicale/acl/LDAP.py

+ 1 - 1
radicale/acl/LDAP.py

@@ -49,7 +49,7 @@ def has_right(owner, user, password):
         log.LOGGER.debug("User %s found" % user)
         try:
             CONNEXION.simple_bind_s(users[0][0], password or "")
-        except ldap.INVALID_CREDENTIALS:
+        except ldap.LDAPError:
             log.LOGGER.debug("Invalid credentials")
         else:
             log.LOGGER.debug("LDAP bind OK")