sobjects/notification.py
branchstable
changeset 3045 82e0b12054a8
parent 3004 09ab5e93a02c
child 3051 2e28226e7de4
equal deleted inserted replaced
3033:5d09f157add0 3045:82e0b12054a8
    54 # hooks #######################################################################
    54 # hooks #######################################################################
    55 
    55 
    56 class RenderAndSendNotificationView(PreCommitOperation):
    56 class RenderAndSendNotificationView(PreCommitOperation):
    57     """delay rendering of notification view until precommit"""
    57     """delay rendering of notification view until precommit"""
    58     def precommit_event(self):
    58     def precommit_event(self):
    59         if self.view.rset and self.view.rset[0][0] in self.session.transaction_data.get('pendingeids', ()):
    59         view = self.view
       
    60         if view.rset is not None and not view.rset:
       
    61             return # entity added and deleted in the same transaction (cache effect)
       
    62         if view.rset and view.rset[0][0] in self.session.transaction_data.get('pendingeids', ()):
    60             return # entity added and deleted in the same transaction
    63             return # entity added and deleted in the same transaction
    61         self.view.render_and_send(**getattr(self, 'viewargs', {}))
    64         self.view.render_and_send(**getattr(self, 'viewargs', {}))
    62 
    65 
    63 
    66 
    64 class StatusChangeHook(Hook):
    67 class StatusChangeHook(Hook):