Use "&" instead of "+" to test booleans

This commit is contained in:
Guillaume Ayoub 2017-05-23 17:11:28 +02:00
parent 85e8336361
commit 22d364729b

View File

@ -198,6 +198,6 @@ class Auth(BaseAuth):
# attacks, see #591.
login_ok = hmac.compare_digest(login, user)
password_ok = self.verify(hash_value, password)
if login_ok + password_ok == 2:
if login_ok & password_ok:
return True
return False