author | Aurelien Campeas <aurelien.campeas@logilab.fr> |
Mon, 03 Jan 2011 11:22:32 +0100 | |
branch | stable |
changeset 6756 | 46297c498842 |
parent 6582 | 8eb7883b4223 |
child 8190 | 2a3c1b787688 |
permissions | -rw-r--r-- |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
1 |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
2 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
3 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
4 |
# This file is part of CubicWeb. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
5 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
6 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
7 |
# terms of the GNU Lesser General Public License as published by the Free |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
8 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
9 |
# any later version. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
10 |
# |
5424
8ecbcbff9777
replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5421
diff
changeset
|
11 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
13 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
14 |
# details. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
15 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
16 |
# You should have received a copy of the GNU Lesser General Public License along |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4843
diff
changeset
|
17 |
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
6142
8bc6eac1fac1
[session] cleanup hook / operation / entity edition api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
18 |
"""some hooks and views to handle supervising of any data changes""" |
0 | 19 |
|
20 |
__docformat__ = "restructuredtext en" |
|
6582
8eb7883b4223
[pylint] fix a bug of pylint detected errors and i18n pb (calling builtins._ instead of req._)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6142
diff
changeset
|
21 |
_ = unicode |
0 | 22 |
|
23 |
from cubicweb import UnknownEid |
|
684 | 24 |
from cubicweb.selectors import none_rset |
2639
5c926026d5e7
R import to avoid warning
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2234
diff
changeset
|
25 |
from cubicweb.schema import display_name |
984 | 26 |
from cubicweb.view import Component |
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3430
diff
changeset
|
27 |
from cubicweb.mail import format_mail |
3430
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
28 |
from cubicweb.server.hook import SendMailOp |
0 | 29 |
|
30 |
||
31 |
def filter_changes(changes): |
|
32 |
""" |
|
33 |
* when an entity has been deleted: |
|
34 |
* don't show deletion of its relations |
|
35 |
* don't show related TrInfo deletion if any |
|
36 |
* when an entity has been added don't show owned_by relation addition |
|
37 |
* don't show new TrInfo entities if any |
|
38 |
""" |
|
39 |
# first build an index of changes |
|
40 |
index = {} |
|
41 |
added, deleted = set(), set() |
|
42 |
for change in changes[:]: |
|
43 |
event, changedescr = change |
|
44 |
if event == 'add_entity': |
|
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
45 |
entity = changedescr.entity |
0 | 46 |
added.add(entity.eid) |
47 |
if entity.e_schema == 'TrInfo': |
|
48 |
changes.remove(change) |
|
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
49 |
event = 'change_state' |
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
50 |
change = (event, |
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
51 |
(entity.wf_info_for[0], |
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
52 |
entity.from_state[0], entity.to_state[0])) |
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
53 |
changes.append(change) |
0 | 54 |
elif event == 'delete_entity': |
55 |
deleted.add(changedescr[0]) |
|
56 |
index.setdefault(event, set()).add(change) |
|
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
57 |
for key in ('delete_relation', 'add_relation'): |
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
58 |
for change in index.get(key, {}).copy(): |
2968
0e3460341023
somewhat painful backport of 3.5 branch, should mostly be ok
Sylvain Thénault <sylvain.thenault@logilab.fr>
diff
changeset
|
59 |
if change[1].rtype == 'in_state': |
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
60 |
index[key].remove(change) |
0 | 61 |
# filter changes |
62 |
for eid in added: |
|
63 |
try: |
|
64 |
for change in index['add_relation'].copy(): |
|
65 |
changedescr = change[1] |
|
66 |
# skip meta-relations which are set automatically |
|
67 |
# XXX generate list below using rtags (category = 'generated') |
|
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
68 |
if changedescr.rtype in ('created_by', 'owned_by', 'is', 'is_instance_of', |
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
69 |
'from_state', 'to_state', 'by_transition', |
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
70 |
'wf_info_for') \ |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
71 |
and changedescr.eidfrom == eid: |
0 | 72 |
index['add_relation'].remove(change) |
73 |
except KeyError: |
|
74 |
break |
|
75 |
for eid in deleted: |
|
76 |
try: |
|
77 |
for change in index['delete_relation'].copy(): |
|
3429
531395cb5a22
[supervising] fix delete_relation() prototype and changedescr usage
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
78 |
if change[1].eidfrom == eid: |
0 | 79 |
index['delete_relation'].remove(change) |
3429
531395cb5a22
[supervising] fix delete_relation() prototype and changedescr usage
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
80 |
elif change[1].eidto == eid: |
0 | 81 |
index['delete_relation'].remove(change) |
3429
531395cb5a22
[supervising] fix delete_relation() prototype and changedescr usage
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
82 |
if change[1].rtype == 'wf_info_for': |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
83 |
for change_ in index['delete_entity'].copy(): |
3429
531395cb5a22
[supervising] fix delete_relation() prototype and changedescr usage
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
84 |
if change_[1].eidfrom == change[1].eidfrom: |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
85 |
index['delete_entity'].remove(change_) |
0 | 86 |
except KeyError: |
87 |
break |
|
88 |
for change in changes: |
|
89 |
event, changedescr = change |
|
90 |
if change in index[event]: |
|
91 |
yield change |
|
92 |
||
93 |
||
661
4f61eb8a96b7
properly kill/depreciate component base class, only keep Component
sylvain.thenault@logilab.fr
parents:
655
diff
changeset
|
94 |
class SupervisionEmailView(Component): |
0 | 95 |
"""view implementing the email API for data changes supervision notification |
96 |
""" |
|
3377
dd9d292b6a6d
use __regid__ instead of id on appobject classes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3163
diff
changeset
|
97 |
__regid__ = 'supervision_notif' |
730 | 98 |
__select__ = none_rset() |
0 | 99 |
|
100 |
def recipients(self): |
|
3430
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
101 |
return self._cw.vreg.config['supervising-addrs'] |
1723 | 102 |
|
0 | 103 |
def subject(self): |
3430
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
104 |
return self._cw._('[%s supervision] changes summary') % self._cw.vreg.config.appid |
1723 | 105 |
|
0 | 106 |
def call(self, changes): |
4835
13b0b96d7982
[repo] enhanced security handling: deprecates unsafe_execute, in favor of explicit read/write security control using the `enabled_security` context manager. Also code executed on the repository side is now unsafe by default.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
107 |
user = self._cw.user |
3430
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
108 |
self.w(self._cw._('user %s has made the following change(s):\n\n') |
0 | 109 |
% user.login) |
110 |
for event, changedescr in filter_changes(changes): |
|
111 |
self.w(u'* ') |
|
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
112 |
getattr(self, event)(changedescr) |
0 | 113 |
self.w(u'\n\n') |
114 |
||
115 |
def _entity_context(self, entity): |
|
116 |
return {'eid': entity.eid, |
|
117 |
'etype': entity.dc_type().lower(), |
|
118 |
'title': entity.dc_title()} |
|
1723 | 119 |
|
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
120 |
def add_entity(self, changedescr): |
3430
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
121 |
msg = self._cw._('added %(etype)s #%(eid)s (%(title)s)') |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
122 |
self.w(u'%s\n' % (msg % self._entity_context(changedescr.entity))) |
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
123 |
self.w(u' %s' % changedescr.entity.absolute_url()) |
1723 | 124 |
|
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
125 |
def update_entity(self, changedescr): |
3430
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
126 |
msg = self._cw._('updated %(etype)s #%(eid)s (%(title)s)') |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
127 |
self.w(u'%s\n' % (msg % self._entity_context(changedescr.entity))) |
0 | 128 |
# XXX print changes |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
129 |
self.w(u' %s' % changedescr.entity.absolute_url()) |
1723 | 130 |
|
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
131 |
def delete_entity(self, (eid, etype, title)): |
3430
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
132 |
msg = self._cw._('deleted %(etype)s #%(eid)s (%(title)s)') |
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
133 |
etype = display_name(self._cw, etype).lower() |
0 | 134 |
self.w(msg % locals()) |
1723 | 135 |
|
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
136 |
def change_state(self, (entity, fromstate, tostate)): |
6582
8eb7883b4223
[pylint] fix a bug of pylint detected errors and i18n pb (calling builtins._ instead of req._)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6142
diff
changeset
|
137 |
_ = self._cw._ |
8eb7883b4223
[pylint] fix a bug of pylint detected errors and i18n pb (calling builtins._ instead of req._)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6142
diff
changeset
|
138 |
msg = _('changed state of %(etype)s #%(eid)s (%(title)s)') |
0 | 139 |
self.w(u'%s\n' % (msg % self._entity_context(entity))) |
1723 | 140 |
self.w(_(' from state %(fromstate)s to state %(tostate)s\n' % |
0 | 141 |
{'fromstate': _(fromstate.name), 'tostate': _(tostate.name)})) |
142 |
self.w(u' %s' % entity.absolute_url()) |
|
1723 | 143 |
|
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
144 |
def _relation_context(self, changedescr): |
4835
13b0b96d7982
[repo] enhanced security handling: deprecates unsafe_execute, in favor of explicit read/write security control using the `enabled_security` context manager. Also code executed on the repository side is now unsafe by default.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
145 |
session = self._cw |
0 | 146 |
def describe(eid): |
147 |
try: |
|
4843
5f7363416765
fix hooks control method name + other litle cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4835
diff
changeset
|
148 |
return session._(session.describe(eid)[0]).lower() |
0 | 149 |
except UnknownEid: |
150 |
# may occurs when an entity has been deleted from an external |
|
151 |
# source and we're cleaning its relation |
|
4843
5f7363416765
fix hooks control method name + other litle cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4835
diff
changeset
|
152 |
return session._('unknown external entity') |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
153 |
eidfrom, rtype, eidto = changedescr.eidfrom, changedescr.rtype, changedescr.eidto |
4843
5f7363416765
fix hooks control method name + other litle cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4835
diff
changeset
|
154 |
return {'rtype': session._(rtype), |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
155 |
'eidfrom': eidfrom, |
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
156 |
'frometype': describe(eidfrom), |
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
157 |
'eidto': eidto, |
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
158 |
'toetype': describe(eidto)} |
1723 | 159 |
|
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
160 |
def add_relation(self, changedescr): |
3430
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
161 |
msg = self._cw._('added relation %(rtype)s from %(frometype)s #%(eidfrom)s to %(toetype)s #%(eidto)s') |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
162 |
self.w(msg % self._relation_context(changedescr)) |
0 | 163 |
|
3429
531395cb5a22
[supervising] fix delete_relation() prototype and changedescr usage
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
164 |
def delete_relation(self, changedescr): |
3430
e6d50513936c
[api] use cw_* in supervising
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3429
diff
changeset
|
165 |
msg = self._cw._('deleted relation %(rtype)s from %(frometype)s #%(eidfrom)s to %(toetype)s #%(eidto)s') |
2841
107ba1c45227
rewrite hooks in sobjects as new Hook style into hooks sub-package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2812
diff
changeset
|
166 |
self.w(msg % self._relation_context(changedescr)) |
1723 | 167 |
|
168 |
||
0 | 169 |
class SupervisionMailOp(SendMailOp): |
170 |
"""special send email operation which should be done only once for a bunch |
|
171 |
of changes |
|
172 |
""" |
|
173 |
def _get_view(self): |
|
2650
18aec79ec3a3
R [vreg] important refactoring of the vregistry, moving behaviour to end dictionnary (and so leaving room for more flexibility ; keep bw compat ; update api usage in cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2649
diff
changeset
|
174 |
return self.session.vreg['components'].select('supervision_notif', |
18aec79ec3a3
R [vreg] important refactoring of the vregistry, moving behaviour to end dictionnary (and so leaving room for more flexibility ; keep bw compat ; update api usage in cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2649
diff
changeset
|
175 |
self.session) |
1723 | 176 |
|
0 | 177 |
def _prepare_email(self): |
178 |
session = self.session |
|
179 |
config = session.vreg.config |
|
180 |
uinfo = {'email': config['sender-addr'], |
|
181 |
'name': config['sender-name']} |
|
182 |
view = self._get_view() |
|
2102
268659907769
finish to update transaction data api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2101
diff
changeset
|
183 |
content = view.render(changes=session.transaction_data.get('pendingchanges')) |
0 | 184 |
recipients = view.recipients() |
185 |
msg = format_mail(uinfo, recipients, content, view.subject(), config=config) |
|
186 |
self.to_send = [(msg, recipients)] |
|
187 |
||
6142
8bc6eac1fac1
[session] cleanup hook / operation / entity edition api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
188 |
def postcommit_event(self): |
0 | 189 |
self._prepare_email() |
6142
8bc6eac1fac1
[session] cleanup hook / operation / entity edition api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
190 |
SendMailOp.postcommit_event(self) |