changeset 3724:f42b05d07650

bugfix: openid RP code had a bug when invalid usernames are entered
author Johannes Berg <johannes AT sipsolutions DOT net>
date Thu, 19 Jun 2008 23:34:07 +0200
parents 7d77145af210
children cf391507fe8e
files MoinMoin/auth/openidrp.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/auth/openidrp.py	Thu Jun 19 00:24:54 2008 +0200
+++ b/MoinMoin/auth/openidrp.py	Thu Jun 19 23:34:07 2008 +0200
@@ -93,6 +93,11 @@
                               value=_('Choose this name')))
         table.append(html.TR().append(td1).append(td2))
 
+    def _get_account_name_inval_user(self, request, form):
+        _ = request.getText
+        msg = _('This is not a valid username, choose a different one.')
+        return self._get_account_name(request, form, msg=msg)
+
     def _associate_account(self, request, form, accountname, msg=None):
         _ = request.getText
 
@@ -170,8 +175,7 @@
         if not newname:
             return MultistageFormLogin(self._get_account_name)
         if not user.isValidName(request, newname):
-            return MultistageFormLogin(self._get_account_name,
-                    _('This is not a valid username, choose a different one.'))
+            return MultistageFormLogin(self._get_account_name_inval_user)
         uid = None
         if newname:
             uid = user.getUserId(request, newname)