From e313e1bc8c934dbf91b6dfccd924f31a8e0a3235 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 29 Mar 2017 22:31:10 -0500 Subject: [PATCH] Tweak logic for registering exception view, to avoid test breakage --- tailbone/views/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tailbone/views/common.py b/tailbone/views/common.py index f72b01e4..98dfd6ce 100644 --- a/tailbone/views/common.py +++ b/tailbone/views/common.py @@ -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