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
This commit is contained in:
Suresh Krishnan 2012-07-28 21:17:00 +00:00
parent 8ff61de5f2
commit fd3a74fa1f

View file

@ -258,6 +258,26 @@ def get_notification_receivers(doc, extra_notify):
return res
def get_pubreq_receivers(doc, extra_notify):
res = []
for r in Role.objects.filter(person=doc.group.ad,name__slug='ad'):
res.append(u'"%s" <%s>' % (r.person.plain_name(), r.email.address))
for x in extra_notify:
if not x in res:
res.append(x)
return res
def get_pubreq_cc_receivers(doc):
res = []
for r in Role.objects.filter(group=doc.group, name__in=("chair", "delegate")):
res.append(u'"%s" <%s>' % (r.person.plain_name(), r.email.address))
return res
def update_tags(request, obj, comment, person, set_tags=[], reset_tags=[], extra_notify=[]):
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
doc = Document.objects.get(pk=obj.pk)
@ -361,6 +381,20 @@ def update_state(request, doc, comment, person, to_state, estimated_date=None, e
person=person,
comment=comment)))
if (to_state.slug=='sub-pub'):
receivers = get_pubreq_receivers(doc, extra_notify)
cc_receivers = get_pubreq_cc_receivers(doc)
send_mail(request, receivers, settings.DEFAULT_FROM_EMAIL,
u"Publication has been requested for draft %s" % doc.name,
'ietfworkflows/state_updated_mail.txt',
dict(doc=doc,
entry=dict(from_state=from_state,
to_state=to_state,
transition_date=doc.time,
person=person,
comment=comment)), cc=cc_receivers)
return
ctype = ContentType.objects.get_for_model(doc)