Commit a85c3704 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[server] Use CryptContext's hash method instead of deprecated encrypt method

Getting rid of the following deprecation warning:


    the method passlib.context.CryptContext.encrypt() is deprecated as of
    Passlib 1.7, and will be removed in Passlib 2.0, use CryptContext.hash()
parent e42cb31e9301
......@@ -66,7 +66,7 @@ def crypt_password(passwd, salt=None):
"""return the encrypted password using the given salt or a generated one
if salt is None:
return _CRYPTO_CTX.encrypt(passwd).encode('ascii')
return _CRYPTO_CTX.hash(passwd).encode('ascii')
# empty hash, accept any password for backwards compat
if salt == '':
return salt
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment