changeset 4428:ded09bdc3902

pre-1.9: request.form has qs args and post data, 1.9: .form only post data, .args only qs args, .values both
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 18 Nov 2008 22:03:57 +0100
parents 06f33d1ce4cb
children 574644cfc6d2
files MoinMoin/action/userprefs.py MoinMoin/userprefs/changepass.py MoinMoin/userprefs/notification.py MoinMoin/userprefs/oid.py MoinMoin/userprefs/suid.py
diffstat 5 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/userprefs.py	Tue Nov 18 21:29:25 2008 +0100
+++ b/MoinMoin/action/userprefs.py	Tue Nov 18 22:03:57 2008 +0100
@@ -16,7 +16,7 @@
     Return error msg_class, msg tuple or None, None.
     """
     _ = request.getText
-    sub = request.form.get('handler')
+    sub = request.values.get('handler')
 
     if sub in request.cfg.userprefs_disabled:
         return None, None
@@ -63,7 +63,7 @@
     # returns text, title, msg_class, msg
     pagename = request.page.page_name
 
-    if 'handler' in request.form:
+    if 'handler' in request.values:
         msg_class, msg = _handle_submission(request)
     else:
         msg_class, msg = None, None
--- a/MoinMoin/userprefs/changepass.py	Tue Nov 18 21:29:25 2008 +0100
+++ b/MoinMoin/userprefs/changepass.py	Tue Nov 18 22:03:57 2008 +0100
@@ -43,8 +43,8 @@
         if request.method != 'POST':
             return
 
-        password = form.get('password1', [''])[0]
-        password2 = form.get('password2', [''])[0]
+        password = form.get('password1', '')
+        password2 = form.get('password2', '')
 
         # Check if password is given and matches with password repeat
         if password != password2:
--- a/MoinMoin/userprefs/notification.py	Tue Nov 18 21:29:25 2008 +0100
+++ b/MoinMoin/userprefs/notification.py	Tue Nov 18 22:03:57 2008 +0100
@@ -32,7 +32,7 @@
         @rtype: list of unicode strings
         @return: list of normalized names
         """
-        text = self.request.form.get(key, [''])[0]
+        text = self.request.form.get(key, '')
         text = text.replace('\r', '')
         items = []
         for item in text.split('\n'):
--- a/MoinMoin/userprefs/oid.py	Tue Nov 18 21:29:25 2008 +0100
+++ b/MoinMoin/userprefs/oid.py	Tue Nov 18 22:03:57 2008 +0100
@@ -59,7 +59,7 @@
         _ = self.request.getText
         request = self.request
 
-        openid_id = request.form.get('openid_identifier', [''])[0]
+        openid_id = request.form.get('openid_identifier', '')
         if not openid_id:
             return 'error', _("No OpenID given.")
 
@@ -133,7 +133,7 @@
         _ = self._
         form = self.request.form
 
-        if form.has_key('oid.return'):
+        if self.request.values.has_key('oid.return'):
             return self._handle_oidreturn()
 
         if form.has_key('cancel'):
--- a/MoinMoin/userprefs/suid.py	Tue Nov 18 21:29:25 2008 +0100
+++ b/MoinMoin/userprefs/suid.py	Tue Nov 18 22:03:57 2008 +0100
@@ -40,7 +40,7 @@
 
         if (wikiutil.checkTicket(self.request, self.request.form['ticket'])
             and self.request.method == 'POST'):
-            uid = form.get('selected_user', [''])[0]
+            uid = form.get('selected_user', '')
             if not uid:
                 return 'error', _("No user selected")
             theuser = user.User(self.request, uid, auth_method='setuid')