diff MoinMoin/PageGraphicalEditor.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 907b9e60c232
children 7b0aadb97d01
line wrap: on
line diff
--- a/MoinMoin/PageGraphicalEditor.py	Sun Dec 23 23:51:55 2007 +0100
+++ b/MoinMoin/PageGraphicalEditor.py	Sun Dec 23 23:52:43 2007 +0100
@@ -24,7 +24,8 @@
 def execute(pagename, request):
     if not request.user.may.write(pagename):
         _ = request.getText
-        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
 
     PageGraphicalEditor(request, pagename).sendEditor()
@@ -85,7 +86,8 @@
 
         # Did one of the prechecks fail?
         if msg:
-            self.send_page(msg=msg)
+            request.theme.add_msg(msg, "error")
+            self.send_page()
             return
 
         # check if we want to load a draft