Only configure exception view when running in production

apparently that supresses normal traceback on console even..
This commit is contained in:
Lance Edgar 2017-03-28 00:54:21 -05:00
parent 7463d4e092
commit 73c0d02b9a

View file

@ -117,12 +117,14 @@ class CommonView(View):
@classmethod
def defaults(cls, config):
rattail_config = config.registry.settings['rattail_config']
# auto-correct URLs which require trailing slash
config.add_notfound_view(cls, attr='notfound', append_slash=True)
# exception
config.add_exception_view(cls, attr='exception', renderer='/exception.mako')
if rattail_config.production():
config.add_exception_view(cls, attr='exception', renderer='/exception.mako')
# home
config.add_route('home', '/')