Tweak logic for registering exception view, to avoid test breakage

This commit is contained in:
Lance Edgar 2017-03-29 22:31:10 -05:00
parent 17aab8f4f0
commit e313e1bc8c

View file

@ -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