Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/okfn/ckan
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjones committed Mar 6, 2012
2 parents 6a2577f + d723c4d commit 5bb1b18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ckan/config/middleware.py
@@ -1,4 +1,5 @@
"""Pylons middleware initialization"""
import urllib
import logging

from beaker.middleware import CacheMiddleware, SessionMiddleware
Expand Down Expand Up @@ -177,7 +178,13 @@ def __call__(self, environ, start_response):

# Current application url
path_info = environ['PATH_INFO']
# sort out weird encodings
path_info = '/'.join(urllib.quote(pce,'') for pce in path_info.split('/'))

qs = environ.get('QUERY_STRING')
# sort out weird encodings
qs = urllib.quote(qs, '')

if qs:
environ['CKAN_CURRENT_URL'] = '%s?%s' % (path_info, qs)
else:
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/layout_base.html
Expand Up @@ -184,7 +184,7 @@ <h3 class="widget-title">Languages</h3>
<div class="textwidget">
<ul>
<?python
current_url = request.environ['CKAN_CURRENT_URL'].encode('utf-8')
current_url = request.environ['CKAN_CURRENT_URL']
?>
<li py:for="locale in h.get_available_locales()">
<a href="${h.url(current_url, locale=str(locale))}">
Expand Down

0 comments on commit 5bb1b18

Please sign in to comment.