Skip to content

Commit fd3a74f

Browse files
When the state changes from whatever to Publication Requested, the regular state change mail will go out.
The regular state change mail will be sent to the authors and the wg chairs (this is the current behavior). Now, in addition to this regular state change mail, another mail will be sent with the title "Publication has been requested for draft <draft-name>" and this mail will be sent to the AD responsible for the WG. I considered sending the mail to both the ADs but decided not to bother the other AD :-). - Legacy-Id: 4704
1 parent 8ff61de commit fd3a74f

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

ietf/ietfworkflows/utils.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,26 @@ def get_notification_receivers(doc, extra_notify):
258258

259259
return res
260260

261+
def get_pubreq_receivers(doc, extra_notify):
262+
res = []
263+
264+
for r in Role.objects.filter(person=doc.group.ad,name__slug='ad'):
265+
res.append(u'"%s" <%s>' % (r.person.plain_name(), r.email.address))
266+
267+
for x in extra_notify:
268+
if not x in res:
269+
res.append(x)
270+
271+
return res
272+
273+
def get_pubreq_cc_receivers(doc):
274+
res = []
275+
276+
for r in Role.objects.filter(group=doc.group, name__in=("chair", "delegate")):
277+
res.append(u'"%s" <%s>' % (r.person.plain_name(), r.email.address))
278+
279+
return res
280+
261281
def update_tags(request, obj, comment, person, set_tags=[], reset_tags=[], extra_notify=[]):
262282
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
263283
doc = Document.objects.get(pk=obj.pk)
@@ -361,6 +381,20 @@ def update_state(request, doc, comment, person, to_state, estimated_date=None, e
361381
person=person,
362382
comment=comment)))
363383

384+
if (to_state.slug=='sub-pub'):
385+
receivers = get_pubreq_receivers(doc, extra_notify)
386+
cc_receivers = get_pubreq_cc_receivers(doc)
387+
388+
send_mail(request, receivers, settings.DEFAULT_FROM_EMAIL,
389+
u"Publication has been requested for draft %s" % doc.name,
390+
'ietfworkflows/state_updated_mail.txt',
391+
dict(doc=doc,
392+
entry=dict(from_state=from_state,
393+
to_state=to_state,
394+
transition_date=doc.time,
395+
person=person,
396+
comment=comment)), cc=cc_receivers)
397+
364398
return
365399

366400
ctype = ContentType.objects.get_for_model(doc)

0 commit comments

Comments
 (0)