hooks/notification.py
changeset 3072 6fb42c53f6df
parent 3023 7864fee8b4ec
child 3163 edfe43ceaa35
equal deleted inserted replaced
3035:2e4a381ea5b7 3072:6fb42c53f6df
    16 
    16 
    17 class RenderAndSendNotificationView(hook.Operation):
    17 class RenderAndSendNotificationView(hook.Operation):
    18     """delay rendering of notification view until precommit"""
    18     """delay rendering of notification view until precommit"""
    19     def precommit_event(self):
    19     def precommit_event(self):
    20         view = self.view
    20         view = self.view
       
    21         if view.rset is not None and not view.rset:
       
    22             return # entity added and deleted in the same transaction (cache effect)
    21         if view.cw_rset and self.session.deleted_in_transaction(view.cw_rset[cw_rset.cw_row or 0][cw_rset.cw_col or 0]):
    23         if view.cw_rset and self.session.deleted_in_transaction(view.cw_rset[cw_rset.cw_row or 0][cw_rset.cw_col or 0]):
    22             return # entity added and deleted in the same transaction
    24             return # entity added and deleted in the same transaction
    23         self.view.render_and_send(**getattr(self, 'viewargs', {}))
    25         self.view.render_and_send(**getattr(self, 'viewargs', {}))
    24 
    26 
    25 
    27