From c9bc01d8b7fb2b64679cedca4c16e310c3c1e739 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Sat, 12 Nov 2011 06:13:21 +0000 Subject: [PATCH] Automatically set the recipients of RFC5742 review emails sent by the IESG based on the RFC Stream. - Legacy-Id: 3603 --- ietf/idrfc/mails.py | 9 +++++++++ ietf/ietfworkflows/models.py | 3 +++ ietf/templates/idrfc/approval_mail_rfc_editor.txt | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ietf/idrfc/mails.py b/ietf/idrfc/mails.py index e5da4afff..fe764eb4e 100644 --- a/ietf/idrfc/mails.py +++ b/ietf/idrfc/mails.py @@ -11,6 +11,8 @@ from django.core.urlresolvers import reverse as urlreverse from ietf.utils.mail import send_mail, send_mail_text from ietf.idtracker.models import * from ietf.ipr.search import iprs_from_docs +from ietf.ietfworkflows.streams import (get_stream_from_draft) +from ietf.ietfworkflows.models import (Stream) def email_state_changed(request, doc, text): to = [x.strip() for x in doc.idinternal.state_change_notice_to.replace(';', ',').split(',')] @@ -160,6 +162,12 @@ def generate_approval_mail_rfc_editor(request, doc): disapproved = doc.idinternal.cur_state_id in IDState.DO_NOT_PUBLISH_STATES doc_type = "RFC" if type(doc) == Rfc else "Internet Draft" + stream = get_stream_from_draft(doc) + to = ", ".join([u"%s <%s>" % x.email() for x in stream.get_chairs_for_document(doc) ]) + if stream.name == "IRTF": + # also send to the IRSG + to += ", Internet Research Steering Group (IRSG) " + return render_to_string("idrfc/approval_mail_rfc_editor.txt", dict(doc=doc, doc_url=settings.IDTRACKER_BASE_URL + doc.idinternal.get_absolute_url(), @@ -167,6 +175,7 @@ def generate_approval_mail_rfc_editor(request, doc): status=status, full_status=full_status, disapproved=disapproved, + to=to, ) ) diff --git a/ietf/ietfworkflows/models.py b/ietf/ietfworkflows/models.py index 2f087b2de..46ab42f38 100644 --- a/ietf/ietfworkflows/models.py +++ b/ietf/ietfworkflows/models.py @@ -213,6 +213,9 @@ class Stream(models.Model): delegates += [i.person for i in self.streamdelegate_set.all()] return delegates + def _ise_chairs_for_document(self, document): + return self._ise_stream_chairs() + def _ise_stream_chairs(self): chairs = [] try: diff --git a/ietf/templates/idrfc/approval_mail_rfc_editor.txt b/ietf/templates/idrfc/approval_mail_rfc_editor.txt index 543f458dd..11399b920 100644 --- a/ietf/templates/idrfc/approval_mail_rfc_editor.txt +++ b/ietf/templates/idrfc/approval_mail_rfc_editor.txt @@ -1,5 +1,5 @@ {% autoescape off %}From: The IESG -To: RFC Editor +To: {{to}} Cc: The IESG , , Subject: Results of IETF-conflict review for {{ doc.file_tag }} {% filter wordwrap:73 %}