Skip to content

Commit

Permalink
[#2375] Cleanup of CKAN_CURRENT_URL as issue also affects legacy temp…
Browse files Browse the repository at this point in the history
…lates
  • Loading branch information
tobes committed Aug 10, 2012
1 parent c531c69 commit 0e7fd02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions ckan/config/middleware.py
Expand Up @@ -201,14 +201,12 @@ def __call__(self, environ, start_response):
path_info = '/'.join(urllib.quote(pce,'') for pce in path_info.split('/'))

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

if qs:
environ['CKAN_CURRENT_URL_RAW'] = '%s?%s' % (path_info, qs)
qs = urllib.quote(qs, '')
# sort out weird encodings
#qs = urllib.quote(qs, '')
environ['CKAN_CURRENT_URL'] = '%s?%s' % (path_info, qs)
else:
environ['CKAN_CURRENT_URL_RAW'] = path_info
environ['CKAN_CURRENT_URL'] = path_info

return self.app(environ, start_response)
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/snippets/language_selector.html
@@ -1,4 +1,4 @@
{% set current_url = request.environ.CKAN_CURRENT_URL_RAW %}
{% set current_url = request.environ.CKAN_CURRENT_URL %}
{% set current_lang = request.environ.CKAN_LANG %}
<form class="form-inline form-select lang-select" action="{% url_for controller='util', action='redirect' %}" data-module="select-switch" method="POST">
<label for="field-lang-select">{{ _('Language') }}</label>
Expand Down

0 comments on commit 0e7fd02

Please sign in to comment.