[Mpuls-commits] r5647 - base/trunk/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Nov 24 12:18:28 CET 2011


Author: ludwig
Date: 2011-11-24 12:18:27 +0100 (Thu, 24 Nov 2011)
New Revision: 5647

Modified:
   base/trunk/mpulsweb/lib/validators.py
Log:
Issue 2696: Empty old password at changing own pw should no be allowed.
So the user always needs to enter the oldpassword, before changing it to
a new password.


Modified: base/trunk/mpulsweb/lib/validators.py
===================================================================
--- base/trunk/mpulsweb/lib/validators.py	2011-11-23 17:31:35 UTC (rev 5646)
+++ base/trunk/mpulsweb/lib/validators.py	2011-11-24 11:18:27 UTC (rev 5647)
@@ -367,8 +367,7 @@
     messages = {'oldpasswd': u'Sie müssen das alte Password korrekt eingeben.'}
 
     def validate_python(self, value, state):
-        if not value == \
-               session['USER_AUTHORIZED'].password:
+        if not (value == session['USER_AUTHORIZED'].password):
             raise formencode.Invalid(self.message('oldpasswd', state),
                                      value, state)
 
@@ -618,7 +617,7 @@
 
 class CheckedNewPasswordForm(NewPasswordForm):
 
-    oldpasswd = OldPassword ()
+    oldpasswd = OldPassword(not_empty=True)
 
 class NewUserForm(BaseFormValidator):
 



More information about the Mpuls-commits mailing list