Skip to content

Commit

Permalink
Merge branch '690-url-for-static-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Jun 14, 2013
2 parents 3dcb714 + 8d4d6b6 commit ac1159b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ckan/lib/helpers.py
Expand Up @@ -86,9 +86,17 @@ def url_for_static(*args, **kw):
'''Create url for static content that does not get translated
eg css, js
wrapper for routes.url_for'''
# make sure that if we specify the url that it is not unicode

def fix_arg(arg):
# make sure that if we specify the url that it is not unicode and
# starts with a /
arg = str(arg)
if not arg.startswith('/'):
arg = '/' + arg
return arg

if args:
args = (str(args[0]), ) + args[1:]
args = (fix_arg(args[0]), ) + args[1:]
my_url = _routes_default_url_for(*args, **kw)
return my_url

Expand Down

0 comments on commit ac1159b

Please sign in to comment.