diff MoinMoin/action/edit.py @ 2966:ba14d391c2ba

Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but instead the separate patch from http://code.google.com/p/google-highly-open-participation-moinmoin/issues/detail?id=51 should be used.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sun, 23 Dec 2007 23:52:43 +0100
parents fff3e18fb5e4
children 7b0aadb97d01
line wrap: on
line diff
--- a/MoinMoin/action/edit.py	Sun Dec 23 23:51:55 2007 +0100
+++ b/MoinMoin/action/edit.py	Sun Dec 23 23:52:43 2007 +0100
@@ -22,8 +22,8 @@
         return
 
     if not request.user.may.write(pagename):
-        Page(request, pagename).send_page(
-            msg=_('You are not allowed to edit this page.'))
+        request.theme.add_msg(_('You are not allowed to edit this page.'), "error")
+        Page(request, pagename).send_page()
         return
 
     valideditors = ['text', 'gui', ]
@@ -80,8 +80,8 @@
     if request.cfg.edit_ticketing:
         ticket = request.form.get('ticket', [''])[0]
         if not wikiutil.checkTicket(request, ticket):
-            msg = _('Please use the interactive user interface to use action %(actionname)s!') % {'actionname': 'edit' }
-            pg.send_page(msg=msg)
+            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
@@ -182,5 +182,5 @@
 
         # sets revision number to default for further actions
         request.rev = 0
-        pg.send_page(msg=savemsg)
-
+        request.theme.add_msg(savemsg, "info")
+        pg.send_page()