[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.
--- 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