equal
deleted
inserted
replaced
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]): |