diff MoinMoin/user.py @ 5971:96ef8a8ecc80

improve some passlib related code using the 1.6.1-post-release doc updates catch all exceptions that might happen when creating CryptContext remove compatibility hack - as hash_needs_update removal was delayed to passlib 2.0, we can just use the deprecated method name to support older and current passlib versions.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 16 Mar 2013 21:47:54 +0100
parents 63412f39e2b4
children 0063e98b14aa
line wrap: on
line diff
--- a/MoinMoin/user.py	Sat Mar 16 18:29:13 2013 +0100
+++ b/MoinMoin/user.py	Sat Mar 16 21:47:54 2013 +0100
@@ -596,10 +596,7 @@
                             # check if we need to recompute the hash. this is needed if either the
                             # passlib hash scheme / hash params changed or if we shall change to a
                             # builtin hash scheme (not recommended):
-                            if not hasattr(pwd_context, 'needs_update'):
-                                # older passlib versions (like 1.3.0) didn't have that method
-                                pwd_context.needs_update = pwd_context.hash_needs_update
-                            recompute_hash = pwd_context.needs_update(d) or wanted_scheme != '{PASSLIB}'
+                            recompute_hash = pwd_context.hash_needs_update(d) or wanted_scheme != '{PASSLIB}'
 
                 else:
                     # a password hash to be checked by legacy, builtin code