diff --git a/ChangeLog b/ChangeLog index bc8b392..77dfb1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2015-02-20 Jan Dittberner * add Jessie requirements file + * fix language check if no Accept-Language header is sent 2014-10-14 Jan Dittberner * add patch by Paul Wise to use to update DUCK link to new static page diff --git a/debianmemberportfolio/lib/base.py b/debianmemberportfolio/lib/base.py index da057f4..7746e92 100644 --- a/debianmemberportfolio/lib/base.py +++ b/debianmemberportfolio/lib/base.py @@ -39,11 +39,15 @@ class BaseController(WSGIController): # the request is routed to. This routing information is # available in environ['pylons.routes_dict'] # set language environment - for lang in request.languages: - try: - add_fallback(lang.replace('-', '_')) - except: - pass + try: + languages = request.languages + for lang in languages: + try: + add_fallback(lang.replace('-', '_')) + except: + pass + except: + pass c.messages = {'errors': [], 'messages': []} return WSGIController.__call__(self, environ, start_response)