hooks/notification.py
changeset 3418 7b49fa7e942d
parent 3376 f5c69485381f
child 3422 089c4b71ac16
equal deleted inserted replaced
3412:368c68ffb99e 3418:7b49fa7e942d
    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:
    21         if view.cw_rset is not None and not view.cw_rset:
    22             return # entity added and deleted in the same transaction (cache effect)
    22             return # entity added and deleted in the same transaction (cache effect)
    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]):
    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]):
    24             return # entity added and deleted in the same transaction
    24             return # entity added and deleted in the same transaction
    25         self.view.render_and_send(**getattr(self, 'viewargs', {}))
    25         self.view.render_and_send(**getattr(self, 'viewargs', {}))
    26 
    26