Skip to content

Commit

Permalink
[#3282] Fix exception when requesting /e or /n
Browse files Browse the repository at this point in the history
Fixes #3282

Due to a bug in how we construct the list of available locales in
`get_locales_from_config` we ended up with `e` and `n` in it. If you
actually requested a URL with /e/ as the lang code you got an exception
because Pylons raised a `LanguageError` when trying to access the `e` or
`n` language files.
  • Loading branch information
amercader committed Oct 21, 2016
1 parent c02e1d0 commit 4daac8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/lib/i18n.py
Expand Up @@ -27,8 +27,9 @@ def get_locales_from_config():
the config AND also the locals available subject to the config. '''
locales_offered = config.get('ckan.locales_offered', '').split()
filtered_out = config.get('ckan.locales_filtered_out', '').split()
locale_default = config.get('ckan.locale_default', 'en')
locale_default = [config.get('ckan.locale_default', 'en')]
locale_order = config.get('ckan.locale_order', '').split()

known_locales = get_locales()
all_locales = (set(known_locales) |
set(locales_offered) |
Expand Down

0 comments on commit 4daac8b

Please sign in to comment.