X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=bluechips%2Fconfig%2Fmiddleware.py;h=c30f8e748607ebe49c762906322c1438ad21b4ba;hb=afa1282a519cc7bda8e11082914ef4045139f113;hp=c8c62fdc5a917ad8ecd55e68896446af0ba578b2;hpb=235ad83ce04a5ad0b6fae19715ded53a37e26f2e;p=bluechips.git diff --git a/bluechips/config/middleware.py b/bluechips/config/middleware.py index c8c62fd..c30f8e7 100644 --- a/bluechips/config/middleware.py +++ b/bluechips/config/middleware.py @@ -54,10 +54,10 @@ def make_app(global_conf, full_stack=True, **app_conf): # Display error documents for 401, 403, 404 status codes (and # 500 when debug is disabled) - if asbool(config['debug']): - app = StatusCodeRedirect(app) - else: - app = StatusCodeRedirect(app, [400, 401, 403, 404, 500]) + status_codes = [400, 401, 403, 404] + if not asbool(config.get('debug')): + status_codes.append(500) + app = StatusCodeRedirect(app, status_codes) # Establish the Registry for this application app = RegistryManager(app)