You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/01/03 19:32:23 UTC
git commit: [#5434] skip StatusCodeRedirect middleware so tasks don't
get run a 2nd time with url /error/document
Updated Branches:
refs/heads/master 763a503ba -> 8e3c5c309
[#5434] skip StatusCodeRedirect middleware so tasks don't get run a 2nd time with url /error/document
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/8e3c5c30
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/8e3c5c30
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/8e3c5c30
Branch: refs/heads/master
Commit: 8e3c5c309f2a1f16c48edabbcc0a69965b8e4635
Parents: 763a503
Author: Dave Brondsema <db...@geek.net>
Authored: Sun Dec 23 19:26:21 2012 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Thu Jan 3 18:32:09 2013 +0000
----------------------------------------------------------------------
Allura/allura/config/middleware.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8e3c5c30/Allura/allura/config/middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py
index 24064fb..68a6d1f 100644
--- a/Allura/allura/config/middleware.py
+++ b/Allura/allura/config/middleware.py
@@ -111,10 +111,12 @@ def _make_core_app(root, global_conf, full_stack=True, **app_conf):
# Converts exceptions to HTTP errors, shows traceback in debug mode
app = tg.error.ErrorHandler(app, global_conf, **config['pylons.errorware'])
# Redirect some status codes to /error/document
- if asbool(config['debug']):
- app = StatusCodeRedirect(app, base_config.handle_status_codes)
- else:
- app = StatusCodeRedirect(app, base_config.handle_status_codes + [500])
+ if config.get('override_root') != 'task':
+ # "task" wsgi would get a 2nd request to /error/document if we used this middleware
+ if asbool(config['debug']):
+ app = StatusCodeRedirect(app, base_config.handle_status_codes)
+ else:
+ app = StatusCodeRedirect(app, base_config.handle_status_codes + [500])
# Redirect 401 to the login page
app = LoginRedirectMiddleware(app)
# Add instrumentation