From 573c35e0ff525d8ac2503fe86a7408aa1c3907a8 Mon Sep 17 00:00:00 2001 From: Henri Kotkanen Date: Tue, 26 May 2015 13:34:45 +0300 Subject: [PATCH] Tag autocomplete: decode percent encoded queries Using urllib.unquote to decode percent encoded query strings before sending them on for matching against the tag db. Also getting the query string as a str object instead of a unicode object for this to work. --- ckan/controllers/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ckan/controllers/api.py b/ckan/controllers/api.py index ddd18f688e2..fe566a90093 100644 --- a/ckan/controllers/api.py +++ b/ckan/controllers/api.py @@ -718,7 +718,8 @@ def dataset_autocomplete(self): return self._finish_ok(resultSet) def tag_autocomplete(self): - q = request.params.get('incomplete', '') + q = request.str_params.get('incomplete', '') + q = unicode(urllib.unquote(q), 'utf-8') limit = request.params.get('limit', 10) tag_names = [] if q: