changeset 5670:f59d02d10935

if edit ticket check fails, send the editor with the current content
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 11 May 2010 22:28:21 +0200
parents 3beb0bca161e
children 172146fe48a2
files MoinMoin/action/edit.py
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/edit.py	Tue May 11 21:25:46 2010 +0200
+++ b/MoinMoin/action/edit.py	Tue May 11 22:28:21 2010 +0200
@@ -79,13 +79,6 @@
     # did user hit cancel button?
     cancelled = 'button_cancel' in request.form
 
-    if request.cfg.edit_ticketing:
-        ticket = request.form.get('ticket', '')
-        if not wikiutil.checkTicket(request, ticket):
-            request.theme.add_msg(_('Please use the interactive user interface to use action %(actionname)s!') % {'actionname': 'edit' }, "error")
-            pg.send_page()
-            return
-
     from MoinMoin.error import ConvertError
     try:
         if lasteditor == 'gui':
@@ -147,8 +140,14 @@
             savetext += ' '
         savetext += category + u'\n' # Should end with newline!
 
+    if request.cfg.edit_ticketing:
+        ticket = request.form.get('ticket', '')
+        if not wikiutil.checkTicket(request, ticket):
+            request.theme.add_msg(_('Please use the interactive user interface to use action %(actionname)s!') % {'actionname': 'edit' }, "error")
+            pg.sendEditor(preview=savetext, comment=comment, staytop=1)
+
     # Preview, spellcheck or spellcheck add new words
-    if ('button_preview' in request.form or
+    elif ('button_preview' in request.form or
         'button_spellcheck' in request.form or
         'button_newwords' in request.form):
         pg.sendEditor(preview=savetext, comment=comment)