Small pep8 related typo fixes
This commit is contained in:
@@ -47,7 +47,8 @@ def has_right(owner, user, password):
|
||||
CONNEXION.simple_bind_s(BINDDN, PASSWORD)
|
||||
|
||||
distinguished_name = "%s=%s" % (ATTRIBUTE, ldap.dn.escape_dn_chars(user))
|
||||
log.LOGGER.debug("LDAP bind for %s in base %s" % (distinguished_name, BASE))
|
||||
log.LOGGER.debug(
|
||||
"LDAP bind for %s in base %s" % (distinguished_name, BASE))
|
||||
|
||||
users = CONNEXION.search_s(BASE, ldap.SCOPE_ONELEVEL, distinguished_name)
|
||||
if users:
|
||||
@@ -61,6 +62,6 @@ def has_right(owner, user, password):
|
||||
return True
|
||||
else:
|
||||
log.LOGGER.debug("User %s not found" % user)
|
||||
|
||||
|
||||
log.LOGGER.debug("LDAP bind failed")
|
||||
return False
|
||||
|
@@ -53,7 +53,7 @@ def _sha1(hash_value, password):
|
||||
"""Check if ``hash_value`` and ``password`` match using sha1 method."""
|
||||
hash_value = hash_value.replace("{SHA}", "").encode("ascii")
|
||||
password = password.encode(config.get("htpasswd_encoding", "stock"))
|
||||
sha1 = hashlib.sha1() # pylint: disable=E1101
|
||||
sha1 = hashlib.sha1() # pylint: disable=E1101
|
||||
sha1.update(password)
|
||||
return sha1.digest() == base64.b64decode(hash_value)
|
||||
|
||||
|
Reference in New Issue
Block a user