changeset 4260:f70003d57e47

Added http_redirect for compatibility
author Florian Krupicka <florian.krupicka@googlemail.com>
date Sat, 02 Aug 2008 15:00:48 +0200
parents e1a63fb9bb4d
children 6de8b4205754
files MoinMoin/web/contexts.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/contexts.py	Fri Aug 01 21:29:06 2008 +0200
+++ b/MoinMoin/web/contexts.py	Sat Aug 02 15:00:48 2008 +0200
@@ -10,8 +10,8 @@
 
 import time, inspect, StringIO, sys
 
-from werkzeug.utils import Headers, http_date, create_environ
-from werkzeug.exceptions import Unauthorized, NotFound
+from werkzeug.utils import Headers, http_date, create_environ, redirect 
+from werkzeug.exceptions import Unauthorized, NotFound, abort
 
 from MoinMoin import i18n, error, user, config
 from MoinMoin.config import multiconfig
@@ -208,6 +208,10 @@
             self.headers.set('Pragma', 'no-cache')
         self.request.expires = time.time() - 3600 * 24 * 365
 
+    def http_redirect(self, url):
+        """ Raise a simple redirect exception. """
+        abort(redirect(url))
+
     def isSpiderAgent(self):
         return check_spider(self.request.user_agent, self.cfg)
     isSpiderAgent = EnvironProxy(isSpiderAgent)