changeset 5153:f4fcdeaab409

fix wrong usage of parseQueryString result
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 19 Sep 2009 17:22:18 +0200
parents cf16b1116dde
children 1eb3596fbd3a
files MoinMoin/action/fullsearch.py MoinMoin/search/results.py MoinMoin/wikiutil.py
diffstat 3 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/fullsearch.py	Sat Sep 19 16:45:26 2009 +0200
+++ b/MoinMoin/action/fullsearch.py	Sat Sep 19 17:22:18 2009 +0200
@@ -210,7 +210,7 @@
             return
     if not results.hits: # no hits?
         f = request.formatter
-        querydict = wikiutil.parseQueryString(request.query_string)
+        querydict = dict(wikiutil.parseQueryString(request.query_string))
         querydict.update({'titlesearch': 0})
 
         request.theme.add_msg(_('Your search query {{{"%s"}}} didn\'t return any results. '
@@ -239,7 +239,7 @@
     hints = []
 
     if titlesearch:
-        querydict = wikiutil.parseQueryString(request.query_string)
+        querydict = dict(wikiutil.parseQueryString(request.query_string))
         querydict.update({'titlesearch': 0})
 
         hints.append(''.join([
--- a/MoinMoin/search/results.py	Sat Sep 19 16:45:26 2009 +0200
+++ b/MoinMoin/search/results.py	Sat Sep 19 17:22:18 2009 +0200
@@ -676,7 +676,7 @@
         """
         _ = self.request.getText
         f = self.formatter
-        querydict = wikiutil.parseQueryString(self.request.query_string)
+        querydict = dict(wikiutil.parseQueryString(self.request.query_string))
 
         def page_url(n):
             querydict.update({'from': n * hitsPerPage})
--- a/MoinMoin/wikiutil.py	Sat Sep 19 16:45:26 2009 +0200
+++ b/MoinMoin/wikiutil.py	Sat Sep 19 17:22:18 2009 +0200
@@ -118,7 +118,11 @@
 
 
 def parseQueryString(qstr, want_unicode=None):
-    """ see werkzeug.url_decode """
+    """ see werkzeug.url_decode
+
+        Please note: this returns a MultiDict, you might need to use dict() on
+                     the result if your code expects a "normal" dict.
+    """
     try:
         assert want_unicode is None
     except AssertionError: