backport stable 3.5
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 27 Aug 2009 20:23:07 +0200
branch3.5
changeset 3046 610a11c683e5
parent 3044 27ded3bbd105 (current diff)
parent 3045 82e0b12054a8 (diff)
child 3050 f4c1994a749d
backport stable
--- a/sobjects/notification.py	Thu Aug 27 19:36:20 2009 +0200
+++ b/sobjects/notification.py	Thu Aug 27 20:23:07 2009 +0200
@@ -56,7 +56,10 @@
 class RenderAndSendNotificationView(PreCommitOperation):
     """delay rendering of notification view until precommit"""
     def precommit_event(self):
-        if self.view.rset and self.view.rset[0][0] in self.session.transaction_data.get('pendingeids', ()):
+        view = self.view
+        if view.rset is not None and not view.rset:
+            return # entity added and deleted in the same transaction (cache effect)
+        if view.rset and view.rset[0][0] in self.session.transaction_data.get('pendingeids', ()):
             return # entity added and deleted in the same transaction
         self.view.render_and_send(**getattr(self, 'viewargs', {}))