getnikola / coil

A user-friendly CMS frontend for Nikola.
https://coil.readthedocs.org/
MIT License
22 stars 10 forks source link

Error if no 'en' translation #45

Closed davidak closed 8 years ago

davidak commented 8 years ago

Coil throws this error if you don't have 'en' as language or translation.

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.5/site-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python3.5/site-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/local/lib/python3.5/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.5/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.5/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/local/lib/python3.5/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.5/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.5/site-packages/flask_login.py", line 758, in decorated_view
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/coil/web.py", line 666, in index
    return render('coil_index.tmpl', context)
  File "/usr/local/lib/python3.5/site-packages/coil/web.py", line 366, in render
    return _site.render_template(template_name, None, context), code, headers
  File "/usr/local/lib/python3.5/site-packages/nikola/nikola.py", line 1165, in render_template
    template_name, None, local_context)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/template/mako.py", line 108, in render_template
    data = template.render_unicode(**context)
  File "/usr/local/lib/python3.5/site-packages/mako/template.py", line 454, in render_unicode
    as_unicode=True)
  File "/usr/local/lib/python3.5/site-packages/mako/runtime.py", line 829, in _render
    **_kwargs_for_callable(callable_, data))
  File "/usr/local/lib/python3.5/site-packages/mako/runtime.py", line 864, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/local/lib/python3.5/site-packages/mako/runtime.py", line 890, in _exec_template
    callable_(context, *args, **kwargs)
  File "/Users/davidak/my_coil_site/cache/.mako.tmp/base.tmpl.py", line 71, in render_body
    __M_writer(str(set_locale(lang)))
  File "/usr/local/lib/python3.5/site-packages/nikola/utils.py", line 1166, in set_locale
    self.__set_locale(lang)
  File "/usr/local/lib/python3.5/site-packages/nikola/utils.py", line 1151, in __set_locale
    locale_n = self.locales[lang]
KeyError: 'en'
Kwpolska commented 8 years ago

Fixed in v1.3.9. Thanks!