From b1353208ecb9972d7eaacf08f4492d019620e0cd Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Thu, 22 Dec 2011 15:07:02 -0800 Subject: [PATCH] Ignore HTTPFound redirect exceptions in the error controller. --- r2/r2/controllers/error.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/r2/r2/controllers/error.py b/r2/r2/controllers/error.py index 705603e2d..75c131f5f 100644 --- a/r2/r2/controllers/error.py +++ b/r2/r2/controllers/error.py @@ -23,6 +23,7 @@ import os.path from mako.filters import url_escape import paste.fileapp +from paste.httpexceptions import HTTPFound from pylons.middleware import error_document_template, media_path from pylons import c, request, g from pylons.i18n import _ @@ -96,6 +97,9 @@ class ErrorController(RedditController): try: c.error_page = True RedditController.__before__(self) + except HTTPFound: + # ignore an attempt to redirect from an error page + pass except: handle_awful_failure("Error occurred in ErrorController.__before__")