changeset 2012:b2c71d9f95e7

split out userform to avoid using it with the enter key
author Johannes Berg <johannes AT sipsolutions DOT net>
date Fri, 20 Apr 2007 15:36:30 +0200
parents 6cd0e4cc8e18
children b8de0a47ad95
files MoinMoin/userform.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/userform.py	Fri Apr 20 15:35:47 2007 +0200
+++ b/MoinMoin/userform.py	Fri Apr 20 15:36:30 2007 +0200
@@ -495,6 +495,7 @@
         """ Create the complete HTML form code. """
         _ = self._
         self.make_form()
+        superuserform = u''
 
         if (self.request.user.isSuperUser() or
             (not self.request._setuid_real_user is None and
@@ -510,6 +511,8 @@
                     ' ',
                 ])
             self.make_row('', button_cell)
+            superuserform = unicode(self._form)
+            self.make_form()
 
         if self.request.user.valid and not create_only:
             buttons = [('save', _('Save')), ('cancel', _('Cancel')), ]
@@ -635,7 +638,7 @@
                 ])
         self.make_row('', button_cell)
 
-        return unicode(self._form)
+        return superuserform + unicode(self._form)
 
 
 def getUserForm(request, create_only=False):