# HG changeset patch # User Denis Laxalde # Date 1481116283 -3600 # Node ID bc9d901cb9e6213b469252b92c8f6736c9dbd1f5 # Parent e42cb31e9301f389f902c561cea1557232d1b663 [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() instead. diff -r e42cb31e9301 -r bc9d901cb9e6 cubicweb/server/utils.py --- a/cubicweb/server/utils.py Thu Oct 22 16:58:12 2015 +0200 +++ b/cubicweb/server/utils.py Wed Dec 07 14:11:23 2016 +0100 @@ -66,7 +66,7 @@ """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