Tweak logic for registering exception view, to avoid test breakage
This commit is contained in:
parent
17aab8f4f0
commit
e313e1bc8c
|
@ -117,13 +117,13 @@ class CommonView(View):
|
|||
|
||||
@classmethod
|
||||
def defaults(cls, config):
|
||||
rattail_config = config.registry.settings['rattail_config']
|
||||
rattail_config = config.registry.settings.get('rattail_config')
|
||||
|
||||
# auto-correct URLs which require trailing slash
|
||||
config.add_notfound_view(cls, attr='notfound', append_slash=True)
|
||||
|
||||
# exception
|
||||
if rattail_config.production():
|
||||
if rattail_config and rattail_config.production():
|
||||
config.add_exception_view(cls, attr='exception', renderer='/exception.mako')
|
||||
|
||||
# home
|
||||
|
|
Loading…
Reference in a new issue