Skip to content

Commit

Permalink
[#4801] Avoid using h.url_for_static when adding a public folder
Browse files Browse the repository at this point in the history
As at this point there isn't a Flask app context yet and we can't call
the url_for function. But if I understand the code correctly we just
want a link to the root of the site, taking into account stuff like root
path settings etc
  • Loading branch information
amercader committed Nov 28, 2019
1 parent 0018cc2 commit 1640a46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/plugins/toolkit.py
Expand Up @@ -344,7 +344,8 @@ def _add_public_directory(cls, config, relative_path):
relative_path,
'extra_public_paths'
)
add_public_path(path, h.url_for_static('/'))
url = h._local_url('/', locale='default')
add_public_path(path, url)

@classmethod
def _add_served_directory(cls, config, relative_path, config_var):
Expand Down

0 comments on commit 1640a46

Please sign in to comment.