From cc9b3de2ecfe50a27ae0b29d5644a6d6159e67e4 Mon Sep 17 00:00:00 2001 From: Corey Hammerton Date: Mon, 14 Dec 2015 21:26:09 -0500 Subject: [PATCH] puppetboard/app: Loading the environments in each error_processor function In the previous commit the environment loading was moving to each request and that functionality change was not reflected in the error processor functions (for 4xx and 5xx series errors) --- puppetboard/app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/puppetboard/app.py b/puppetboard/app.py index 2b83a37..fa4342b 100644 --- a/puppetboard/app.py +++ b/puppetboard/app.py @@ -95,16 +95,19 @@ def utility_processor(): @app.errorhandler(400) def bad_request(e): + envs = environments() return render_template('400.html', envs=envs), 400 @app.errorhandler(403) def forbidden(e): + envs = environments() return render_template('403.html', envs=envs), 400 @app.errorhandler(404) def not_found(e): + envs = environments() return render_template('404.html', envs=envs), 404 @@ -112,11 +115,13 @@ def not_found(e): def precond_failed(e): """We're slightly abusing 412 to handle missing features depending on the API version.""" + envs = environments() return render_template('412.html', envs=envs), 412 @app.errorhandler(500) def server_error(e): + envs = environments() return render_template('500.html', envs=envs), 500