Skip to content

Commit

Permalink
Fixed the url_for_static helper with root path
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre authored and wardi committed May 25, 2016
1 parent 3ba76e1 commit 6148c25
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ckan/lib/helpers.py
Expand Up @@ -107,7 +107,7 @@ def url(*args, **kw):
wrapper for pylons.url'''
locale = kw.pop('locale', None)
my_url = _pylons_default_url(*args, **kw)
return _add_i18n_to_url(my_url, locale=locale, **kw)
return _local_url(my_url, locale=locale, **kw)


def url_for(*args, **kw):
Expand Down Expand Up @@ -141,7 +141,7 @@ def url_for(*args, **kw):
kw['ver'] = '/%s' % ver
my_url = _routes_default_url_for(*args, **kw)
kw['__ckan_no_root'] = no_root
return _add_i18n_to_url(my_url, locale=locale, **kw)
return _local_url(my_url, locale=locale, **kw)


def url_for_static(*args, **kw):
Expand Down Expand Up @@ -176,8 +176,10 @@ def fix_arg(arg):

if args:
args = (fix_arg(args[0]), ) + args[1:]
if kw.get('qualified', False):
kw['protocol'], kw['host'] = get_site_protocol_and_host()
my_url = _routes_default_url_for(*args, **kw)
return my_url
return _local_url(my_url, locale='default', **kw)


def is_url(*args, **kw):
Expand All @@ -195,7 +197,7 @@ def is_url(*args, **kw):
return url.scheme in valid_schemes


def _add_i18n_to_url(url_to_amend, **kw):
def _local_url(url_to_amend, **kw):
# If the locale keyword param is provided then the url is rewritten
# using that locale .If return_to is provided this is used as the url
# (as part of the language changing feature).
Expand Down

0 comments on commit 6148c25

Please sign in to comment.