diff MoinMoin/action/newaccount.py @ 2997:c5cc1a0db4b2

fix password_checker userform code (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Jan 2008 17:26:27 +0100
parents 7b0aadb97d01
children ed1a433803c6
line wrap: on
line diff
--- a/MoinMoin/action/newaccount.py	Sun Jan 06 17:08:31 2008 +0100
+++ b/MoinMoin/action/newaccount.py	Sun Jan 06 17:26:27 2008 +0100
@@ -48,18 +48,18 @@
     password = form.get('password', [''])[0]
     password2 = form.get('password2', [''])[0]
 
+    # Check if password is given and matches with password repeat
+    if password != password2:
+        return _("Passwords don't match!")
+    if not password:
+        return _("Please specify a password!")
+
     pw_checker = request.cfg.password_checker
     if pw_checker:
         pw_error = pw_checker(theuser.name, password)
         if pw_error:
             return _("Password not acceptable: %s") % pw_error
 
-    # Check if password is given and matches with password repeat
-    if password != password2:
-        return _("Passwords don't match!")
-    if not password:
-        return _("Please specify a password!")
-
     # Encode password
     if password and not password.startswith('{SHA}'):
         try: