hooks/notification.py
branchstable
changeset 7879 9aae456abab5
parent 7815 2a164a9cf81c
child 8190 2a3c1b787688
child 8227 884405bf3621
equal deleted inserted replaced
7874:be04706eacc9 7879:9aae456abab5
    26 from cubicweb.server import hook
    26 from cubicweb.server import hook
    27 from cubicweb.sobjects.supervising import SupervisionMailOp
    27 from cubicweb.sobjects.supervising import SupervisionMailOp
    28 
    28 
    29 class RenderAndSendNotificationView(hook.Operation):
    29 class RenderAndSendNotificationView(hook.Operation):
    30     """delay rendering of notification view until precommit"""
    30     """delay rendering of notification view until precommit"""
       
    31     view = None # make pylint happy
       
    32 
    31     def precommit_event(self):
    33     def precommit_event(self):
    32         view = self.view
    34         view = self.view
    33         if view.cw_rset is not None and not view.cw_rset:
    35         if view.cw_rset is not None and not view.cw_rset:
    34             return # entity added and deleted in the same transaction (cache effect)
    36             return # entity added and deleted in the same transaction (cache effect)
    35         if view.cw_rset and self.session.deleted_in_transaction(view.cw_rset[view.cw_row or 0][view.cw_col or 0]):
    37         if view.cw_rset and self.session.deleted_in_transaction(view.cw_rset[view.cw_row or 0][view.cw_col or 0]):