Skip to content

Commit

Permalink
Tag autocomplete: decode percent encoded queries
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hkotkanen committed May 26, 2015
1 parent 0f145a5 commit 573c35e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/controllers/api.py
Expand Up @@ -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:
Expand Down

0 comments on commit 573c35e

Please sign in to comment.