changeset 2203:1dbca960f9f6

send modified signal before destroying
author Ana Balica <ana.balica@gmail.com>
date Mon, 23 Sep 2013 20:50:38 +0200
parents 9a719f7dfd9d
children c574f206f39f
files MoinMoin/items/__init__.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Mon Sep 23 20:45:16 2013 +0200
+++ b/MoinMoin/items/__init__.py	Mon Sep 23 20:50:38 2013 +0200
@@ -388,6 +388,9 @@
         return self._save(self.meta, self.content.data, action=ACTION_REVERT, comment=comment)
 
     def destroy(self, comment=u'', destroy_item=False):
+        action = DESTROY_ALL if destroy_item else DESTROY_REV
+        item_modified.send(app, item_name=self.name, action=action, meta=self.meta,
+                           content=self.rev.data, comment=comment)
         # called from destroy UI/POST
         if destroy_item:
             # destroy complete item with all revisions, metadata, etc.
@@ -395,9 +398,6 @@
         else:
             # just destroy this revision
             self.rev.item.destroy_revision(self.rev.revid)
-        action = DESTROY_ALL if destroy_item else DESTROY_REV
-        item_modified.send(app, item_name=self.name, action=action, meta=self.meta,
-                           content=self.rev.data, comment=comment)
 
     def modify(self, meta, data, comment=u'', contenttype_guessed=None, **update_meta):
         meta = dict(meta)  # we may get a read-only dict-like, copy it