Skip to content

Commit

Permalink
skip url_for only
Browse files Browse the repository at this point in the history
  • Loading branch information
Zharktas authored and tino097 committed Sep 26, 2017
1 parent 0ae06c8 commit d8bb769
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ckan/lib/helpers.py
Expand Up @@ -170,11 +170,16 @@ def redirect_to(*args, **kw):
'/user/logged_in']
matching = [s for s in uargs if any(xs in s for xs in exempt_urls)]

_url = ''
skip_url_parsing = False
if uargs and len(uargs) is 1 and isinstance(uargs[0], basestring) \
and uargs[0].startswith('/') and len(matching) is 0:
return _routes_redirect_to(uargs[0])
skip_url_parsing = True
_url = uargs[0]

if skip_url_parsing is False:
_url = url_for(*uargs, **kw)

_url = url_for(*uargs, **kw)
if _url.startswith('/'):
_url = str(config['ckan.site_url'].rstrip('/') + _url)

Expand Down

0 comments on commit d8bb769

Please sign in to comment.