changeset 3303:b6681bd81cdb

use a proper redirect for backto so that the URL isn't bogus
author Johannes Berg <johannes AT sipsolutions DOT net>
date Tue, 18 Mar 2008 18:46:21 +0100
parents 7f44c25af462
children db48ab0b2bf8
files MoinMoin/PageEditor.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Tue Mar 18 18:36:51 2008 +0100
+++ b/MoinMoin/PageEditor.py	Tue Mar 18 18:46:21 2008 +0100
@@ -520,9 +520,12 @@
         self.lock.release()
 
         backto = request.form.get('backto', [None])[0]
-        page = backto and Page(request, backto) or self
-        request.theme.add_msg(_('Edit was cancelled.'), "error")
-        page.send_page()
+        if backto:
+            pg = Page(request, backto)
+            request.http_redirect(pg.url(request, relative=False))
+        else:
+            request.theme.add_msg(_('Edit was cancelled.'), "error")
+            page.send_page()
 
     def copyPage(self, newpagename, comment=None):
         """ Copy the current version of the page (keeping the backups, logs and attachments).