changeset 148:4a64816584ae

fixed MoinMoinBugs/MailStatusOnDeletePage imported from: moin--main--1.5--patch-150
author Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
date Fri, 28 Oct 2005 10:01:17 +0000
parents 22bf3aa88bc7
children c5b967d9d1e6
files MoinMoin/PageEditor.py MoinMoin/action/DeletePage.py
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Fri Oct 28 06:34:52 2005 +0000
+++ b/MoinMoin/PageEditor.py	Fri Oct 28 10:01:17 2005 +0000
@@ -488,12 +488,19 @@
         and keeping the backups, logs and attachments).
         
         @param comment: Comment given by user
+        @rtype: unicode
+        @return: error message
         """
         # First save a final backup copy of the current page
         # (recreating the page allows access to the backups again)
+        _ = self._
+        
         try:
-            self.saveText(u"deleted\n", 0, comment=comment or u'')
-        except self.SaveError, msg:
+            msg = self.saveText(u"deleted\n", 0, comment=comment or u'')
+            msg = msg.replace(
+                _("Thank you for your changes. Your attention to detail is appreciated."),
+                _('Page "%s" was successfully deleted!') % (self.page_name,))
+        except self.SaveError, message:
             # XXX Error handling
             pass
         # Then really delete it
@@ -523,6 +530,7 @@
             key = formatter_name
             cache = caching.CacheEntry(self.request, arena, key)
             cache.remove()
+        return msg
 
     def _sendNotification(self, comment, emails, email_lang, revisions, trivial):
         """
--- a/MoinMoin/action/DeletePage.py	Fri Oct 28 06:34:52 2005 +0000
+++ b/MoinMoin/action/DeletePage.py	Fri Oct 28 10:01:17 2005 +0000
@@ -41,10 +41,9 @@
                 msg = _('Please use the interactive user interface to delete pages!'))
 
         # Delete the page
-        page.deletePage(request.form.get('comment', [u''])[0])
+        msg = page.deletePage(request.form.get('comment', [u''])[0])
 
-        return page.send_page(request,
-                msg = _('Page "%s" was successfully deleted!') % (pagename,))
+        return page.send_page(request, msg = msg)
 
     # send deletion form
     ticket = wikiutil.createTicket()