[mod] remove backward compatible code for passlib and force modern version
authorLaurent Peuch <cortex@worlddomination.be>
Fri, 12 Apr 2019 13:52:17 +0200
changeset 12574 6ccf8fda063f
parent 12573 9b883489279f
child 12575 30d0e27a1d52
[mod] remove backward compatible code for passlib and force modern version
cubicweb/server/utils.py
setup.py
--- a/cubicweb/server/utils.py	Fri Apr 12 11:54:42 2019 +0200
+++ b/cubicweb/server/utils.py	Fri Apr 12 13:52:17 2019 +0200
@@ -51,9 +51,7 @@
 
 _CRYPTO_CTX = CryptContext(['sha512_crypt', CustomMD5Crypt, 'des_crypt', 'ldap_salted_sha1'],
                            deprecated=['cubicwebmd5crypt', 'des_crypt'])
-# for bw compat with passlib < 1.7
-if not hasattr(_CRYPTO_CTX, 'hash'):
-    _CRYPTO_CTX.hash = _CRYPTO_CTX.encrypt
+
 verify_and_update = _CRYPTO_CTX.verify_and_update
 
 
--- a/setup.py	Fri Apr 12 11:54:42 2019 +0200
+++ b/setup.py	Fri Apr 12 13:52:17 2019 +0200
@@ -69,7 +69,7 @@
         'yams >= 0.45.0',
         'lxml',
         'logilab-database >= 1.15.0',
-        'passlib',
+        'passlib >= 1.7',
         'pytz',
         'Markdown',
         'filelock',