[Mpuls-commits] r1901 - wasko/branches/2.0/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 5 15:24:49 CET 2010


Author: torsten
Date: 2010-03-05 15:24:47 +0100 (Fri, 05 Mar 2010)
New Revision: 1901

Modified:
   wasko/branches/2.0/mpulsweb/lib/validators.py
Log:
* mpulsweb/lib/validators.py (SecurePassword.validate_python): Fixed
	mpuls issue 1290. Ensure that userpassword does not contain only
	numbers or special chars.


Modified: wasko/branches/2.0/mpulsweb/lib/validators.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/validators.py	2010-03-05 13:38:29 UTC (rev 1900)
+++ wasko/branches/2.0/mpulsweb/lib/validators.py	2010-03-05 14:24:47 UTC (rev 1901)
@@ -112,6 +112,8 @@
                     u' Zeichen lang sein'),
         'non_letter': (u'Sie müssen mindestens %(non_letter)s'
                        u' Nicht-Buchstaben in Ihrem Passwort verwenden.'),
+        'too_few_letter': (u'Das Passwort darf nicht nur aus Zahlen '
+                          u'oder Sonderzeichen bestehen.'),
         'only_ascii': u'Das Passwort darf nur aus ASCII-Zeichen bestehen.'
         }
 
@@ -136,6 +138,9 @@
             raise formencode.Invalid(self.message("non_letter", state,
                                            non_letter=self.non_letter_literal),
                                      value, state)
+        if len(non_letters) == len(value): 
+            raise formencode.Invalid(self.message("too_few_letter", state), 
+                                    value, state)
 
 
 class UserGroupExistsCheck(formencode.validators.FancyValidator):



More information about the Mpuls-commits mailing list