Author: tmckay
Date: 2012-02-10 17:16:46 +0000 (Fri, 10 Feb 2012)
New Revision: 5214
Modified:
trunk/cumin/python/cumin/widgets.py
Log:
Add a check for "/index.html" on redirect to front page to avoid
any possibility of an infinite redirect loop
Modified: trunk/cumin/python/cumin/widgets.py
===================================================================
--- trunk/cumin/python/cumin/widgets.py 2012-02-10 16:24:34 UTC (rev 5213)
+++ trunk/cumin/python/cumin/widgets.py 2012-02-10 17:16:46 UTC (rev 5214)
@@ -1331,10 +1331,14 @@
def redirect_on_exception(self, session, e):
# If we have an exception from a missing object, redirect to the
- # main page with a notice instead of using the not_found_tmpl below
- if type(e) is RosemaryNotFound:
+ # main page with a notice instead of using the not_found_tmpl below.
+ # Test for presence on the index.html page already to avoid any possibility
+ # of an infinite redirect loop.
+ if type(e) is RosemaryNotFound and \
+ session.request_environment["REQUEST_URI"] !=
"/index.html":
+
session.add_notice(Notice("An object being displayed became
unavailable"))
- return "index.html"
+ return "/index.html"
def render_error(self, session):
cls, value, traceback = sys.exc_info()
Show replies by date