equal
deleted
inserted
replaced
8 __docformat__ = "restructuredtext en" |
8 __docformat__ = "restructuredtext en" |
9 |
9 |
10 from logilab.common.textutils import normalize_text |
10 from logilab.common.textutils import normalize_text |
11 |
11 |
12 from cubicweb import RegistryException |
12 from cubicweb import RegistryException |
13 from cubicweb.selectors import entity_implements |
13 from cubicweb.selectors import implements |
14 from cubicweb.server import hook |
14 from cubicweb.server import hook |
15 from cubicweb.sobjects.supervising import SupervisionMailOp |
15 from cubicweb.sobjects.supervising import SupervisionMailOp |
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""" |
35 |
35 |
36 |
36 |
37 class StatusChangeHook(NotificationHook): |
37 class StatusChangeHook(NotificationHook): |
38 """notify when a workflowable entity has its state modified""" |
38 """notify when a workflowable entity has its state modified""" |
39 __regid__ = 'notifystatuschange' |
39 __regid__ = 'notifystatuschange' |
40 __select__ = NotificationHook.__select__ & entity_implements('TrInfo') |
40 __select__ = NotificationHook.__select__ & implements('TrInfo') |
41 events = ('after_add_entity',) |
41 events = ('after_add_entity',) |
42 |
42 |
43 def __call__(self): |
43 def __call__(self): |
44 entity = self.entity |
44 entity = self.entity |
45 if not entity.from_state: # not a transition |
45 if not entity.from_state: # not a transition |