Skip to content

Commit ad444bd

Browse files
committed
checkpoint
- Legacy-Id: 10007
1 parent aebd885 commit ad444bd

9 files changed

Lines changed: 121 additions & 23 deletions

File tree

ietf/doc/mails.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from ietf.doc.models import WriteupDocEvent, BallotPositionDocEvent, LastCallDocEvent, DocAlias, ConsensusDocEvent, DocTagName
1313
from ietf.doc.utils import needed_ballot_positions
1414
from ietf.person.models import Person
15-
from ietf.group.models import Group, Role
15+
from ietf.group.models import Role
1616
from ietf.doc.models import Document
1717
from ietf.mailtoken.utils import gather_addresses
1818

@@ -217,27 +217,16 @@ def generate_approval_mail_rfc_editor(request, doc):
217217
disapproved = doc.get_state_slug("draft-iesg") in DO_NOT_PUBLISH_IESG_STATES
218218
doc_type = "RFC" if doc.get_state_slug() == "rfc" else "Internet Draft"
219219

220-
to = []
221-
if doc.group.type_id != "individ":
222-
for r in doc.group.role_set.filter(name="chair").select_related():
223-
to.append(r.formatted_email())
224-
225-
if doc.stream_id in ("ise", "irtf"):
226-
# include ISE/IRTF chairs
227-
g = Group.objects.get(acronym=doc.stream_id)
228-
for r in g.role_set.filter(name="chair").select_related():
229-
to.append(r.formatted_email())
230-
231-
if doc.stream_id == "irtf":
232-
# include IRSG
233-
to.append('"Internet Research Steering Group" <irsg@irtf.org>')
220+
to = gather_addresses('ballot_approved_conflrev', doc=doc)
221+
cc = gather_addresses('ballot_approved_conflrev_cc', doc=doc)
234222

235223
return render_to_string("doc/mail/approval_mail_rfc_editor.txt",
236224
dict(doc=doc,
237225
doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),
238226
doc_type=doc_type,
239227
disapproved=disapproved,
240-
to=", ".join(to),
228+
to=",\n ".join(to),
229+
cc=",\n ".join(cc),
241230
)
242231
)
243232

ietf/doc/utils_charter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from ietf.person.models import Person
99
from ietf.utils.history import find_history_active_at
1010
from ietf.utils.mail import send_mail_text
11+
from ietf.mailtoken.utils import gather_addresses
1112

1213
def charter_name_for_group(group):
1314
if group.type_id == "rg":
@@ -126,6 +127,8 @@ def default_action_text(group, charter, by):
126127
techadv=group.role_set.filter(name="techadv"),
127128
milestones=group.groupmilestone_set.filter(state="charter"),
128129
action_type=action,
130+
to=", ".join(gather_addresses('ballot_approved_charter',doc=charter,group=group)),
131+
cc=", ".join(gather_addresses('ballot_approved_charter_cc',doc=charter,group=group)),
129132
))
130133

131134
e.save()

ietf/doc/views_status_change.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from ietf.person.models import Person
2323
from ietf.utils.mail import send_mail_preformatted
2424
from ietf.utils.textupload import get_cleaned_text_file_content
25+
from ietf.mailtoken.utils import gather_addresses
2526

2627
class ChangeStateForm(forms.Form):
2728
new_state = forms.ModelChoiceField(State.objects.filter(type="statchg", used=True), label="Status Change Evaluation State", empty_label=None, required=True)
@@ -298,6 +299,8 @@ def default_approval_text(status_change,relateddoc):
298299
approved_text = current_text,
299300
action=action,
300301
newstatus=newstatus(relateddoc),
302+
to=", ".join(gather_addresses('ballot_approved_status_change',doc=status_change)),
303+
cc=", ".join(gather_addresses('ballot_approved_status_change_cc',doc=status_change)),
301304
)
302305
)
303306

ietf/mailtoken/migrations/0002_auto_20150809_1314.py

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def make_recipients(apps):
4545
desc="The chairs of groups of the subject documents of a conflict-review or status-change",
4646
template=None)
4747

48+
rc(slug='doc_affecteddoc_notify',
49+
desc="The notify field of the subject documents of a conflict-review or status-change",
50+
template=None)
51+
4852
rc(slug='doc_shepherd',
4953
desc="The document's shepherd",
5054
template='{% if doc.shepherd %}{{doc.shepherd.address}}{% endif %}' )
@@ -57,14 +61,38 @@ def make_recipients(apps):
5761
desc="The list address of the document's group",
5862
template=None )
5963

64+
rc(slug='doc_stream_owner',
65+
desc="The owner of the document's stream",
66+
template='{% if doc.stream_id == "ise" %}<rfc-ise@rfc-editor.org>{% endif %}{% if doc.stream_id == "irtf" %}<irtf-chair@irtf.org>{% endif %}{% if doc.stream_id == "ietf" %}<iesg@ietf.org>{% endif %}')
67+
6068
rc(slug='conflict_review_stream_owner',
6169
desc="The stream owner of a document being reviewed for IETF stream conflicts",
62-
template='{% ifequal doc.type_id "conflrev" %}{% ifequal doc.stream_id "ise" %}<rfc-ise@rfc-editor.org>{% endifequal %}{% ifequal doc.stream_id "irtf" %}<irtf-chair@irtf.org>{% endifequal %}{% endifequal %}')
70+
template = None )
71+
72+
rc(slug='conflict_review_steering_group',
73+
desc="The steering group (e.g. IRSG) of a document being reviewed for IETF stream conflicts",
74+
template = None)
6375

6476
rc(slug='iana_approve',
6577
desc="IANA's draft approval address",
6678
template='IANA <drafts-approval@icann.org>')
6779

80+
rc(slug='iana',
81+
desc="IANA",
82+
template='<iana@iana.org>')
83+
84+
rc(slug='group_mail_list',
85+
desc="The group's mailing list",
86+
template='{{ group.list_email }}')
87+
88+
rc(slug='group_steering_group',
89+
desc="The group's steering group (IESG or IRSG)",
90+
template=None)
91+
92+
rc(slug='group_chairs',
93+
desc="The group's chairs",
94+
template="{{group.acronym}}-chairs@ietf.org")
95+
6896
def make_mailtokens(apps):
6997

7098
Recipient=apps.get_model('mailtoken','Recipient')
@@ -85,6 +113,7 @@ def mt_factory(slug,desc,recipient_slugs):
85113
'doc_shepherd',
86114
'doc_affecteddoc_authors',
87115
'doc_affecteddoc_group_chairs',
116+
'doc_affecteddoc_notify',
88117
'conflict_review_stream_owner',
89118
])
90119

@@ -98,6 +127,7 @@ def mt_factory(slug,desc,recipient_slugs):
98127
'doc_shepherd',
99128
'doc_affecteddoc_authors',
100129
'doc_affecteddoc_group_chairs',
130+
'doc_affecteddoc_notify',
101131
'conflict_review_stream_owner',
102132
])
103133

@@ -121,6 +151,49 @@ def mt_factory(slug,desc,recipient_slugs):
121151
desc='Recipients for IANA message when an IETF stream document ballot is approved',
122152
recipient_slugs=['iana_approve'])
123153

154+
mt_factory(slug='ballot_approved_conflrev',
155+
desc='Recipients when a conflict review ballot is approved',
156+
recipient_slugs=['conflict_review_stream_owner',
157+
'conflict_review_steering_group',
158+
'doc_affecteddoc_authors',
159+
'doc_affecteddoc_group_chairs',
160+
'doc_affecteddoc_notify',
161+
'doc_notify',
162+
])
163+
164+
mt_factory(slug='ballot_approved_conflrev_cc',
165+
desc='Copied when a conflict review ballot is approved',
166+
recipient_slugs=['iesg',
167+
'ietf_announce',
168+
'iana',
169+
])
170+
171+
mt_factory(slug='ballot_approved_charter',
172+
desc='Recipients when a charter is approved',
173+
recipient_slugs=['ietf_announce',])
174+
175+
mt_factory(slug='ballot_approved_charter_cc',
176+
desc='Copied when a charter is approved',
177+
recipient_slugs=['group_mail_list',
178+
'group_steering_group',
179+
'group_chairs',
180+
'doc_notify',
181+
])
182+
183+
mt_factory(slug='ballot_approved_status_change',
184+
desc='Recipients when a status change is approved',
185+
recipient_slugs=['ietf_announce',])
186+
187+
mt_factory(slug='ballot_approved_status_change_cc',
188+
desc='Copied when a status change is approved',
189+
recipient_slugs=['iesg',
190+
'rfc_editor',
191+
'doc_notify',
192+
'doc_affectddoc_authors',
193+
'doc_affecteddoc_group_chairs',
194+
'doc_affecteddoc_notify',
195+
])
196+
124197

125198
def forward(apps, schema_editor):
126199

ietf/mailtoken/models.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,33 @@ def gather_doc_affecteddoc_group_chairs(self, **kwargs):
6767
addrs.extend(Recipient.objects.get(slug='doc_group_chairs').gather(**{'doc':reldoc.document}))
6868
return addrs
6969

70+
def gather_doc_affecteddoc_notify(self, **kwargs):
71+
addrs = []
72+
if 'doc' in kwargs:
73+
for reldoc in kwargs['doc'].related_that_doc(['conflrev','tohist','tois','tops']):
74+
addrs.extend(Recipient.objects.get(slug='doc_notify').gather(**{'doc':reldoc.document}))
75+
return addrs
76+
77+
def gather_conflict_review_stream_owner(self, **kwargs):
78+
addrs = []
79+
if 'doc' in kwargs:
80+
for reldoc in kwargs['doc'].related_that_doc(['conflrev']):
81+
addrs.extend(Recipient.objects.get(slug='doc_stream_owner').gather(**{'doc':reldoc.document}))
82+
return addrs
83+
84+
def gather_conflict_review_steering_group(self,**kwargs):
85+
addrs = []
86+
if 'doc' in kwargs:
87+
for reldoc in kwargs['doc'].related_that_doc(['conflrev']):
88+
if reldoc.document.stream_id=='irsg':
89+
addrs.append('"Internet Research Steering Group" <irsg@ietf.org>')
90+
return addrs
91+
92+
def gather_group_steering_group(self,**kwargs):
93+
addrs = []
94+
sg_map = dict( wg='"The IESG" <iesg@ietf.org>', rg='"Internet Research Steering Group" <irsg@ietf.org>' )
95+
if 'group' in kwargs and kwargs['group'].type_id in sg_map:
96+
addrs.append(sg_map[kwargs['group'].type_id])
97+
return addrs
98+
99+

ietf/templates/doc/charter/action_text.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% load ietf_filters %}{% autoescape off %}From: The IESG <iesg-secretary@ietf.org>
2-
To: IETF-Announce <ietf-announce@ietf.org>{% if group.list_email %}
3-
Cc: {{ group.acronym }} {{ group.type.name }} <{{ group.list_email }}> {% endif %}
2+
To: {{ to }}{% if cc %}
3+
Cc: {{ cc }} {% endif %}
44
Subject: WG Action: {{ action_type }} {{ group.name }} ({{ group.acronym }})
55

66
{% filter wordwrap:73 %}{% if action_type == "Formed" %}A new IETF working group has been formed in the {{ group.parent.name }}.{% endif %}{% if action_type == "Rechartered" %}The {{ group.name }} ({{ group.acronym }}) working group in the {{ group.parent.name }} of the IETF has been rechartered.{% endif %} For additional information please contact the Area Directors or the {{ group.type.name }} Chair{{ chairs|pluralize}}.

ietf/templates/doc/mail/approval_mail_rfc_editor.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% load mail_filters %}{% autoescape off %}From: The IESG <iesg-secretary@ietf.org>
22
To: {{to}}
3-
Cc: The IESG <iesg@ietf.org>, <iana@iana.org>, <ietf-announce@ietf.org>
3+
Cc: {{cc}}
44
Subject: Results of IETF-conflict review for {{ doc.file_tag }}
55
{% filter wordwrap:73 %}
66
The IESG has completed a review of <{{ doc.name }}> consistent with RFC5742. This review is applied to all non-IETF streams.

ietf/templates/doc/status_change/approval_text.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% load mail_filters %}{% autoescape off %}From: The IESG <iesg-secretary@ietf.org>
2-
To: IETF-Announce <ietf-announce@ietf.org>
3-
Cc: RFC Editor <rfc-editor@rfc-editor.org>, {{status_change.notify}}
2+
To: {{ to }}{% if cc %}
3+
Cc: {{ cc }}{% endif %}
44
Subject: {{action}}: {{relateddoc.target.document.title}} to {{newstatus}}
55

66
{% filter wordwrap:73 %}The IESG has approved changing the status of the following document:

ietf/utils/test_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def other_doc_factory(type_id,name):
335335
# This won't allow testing the results of the production configuration - if we want to do that, we'll need to
336336
# extract the production data either directly, or as a fixture
337337
recipient = Recipient.objects.create(slug='bogus_recipient',desc='Bogus Recipient',template='bogus@example.com')
338-
for slug in [u'ballot_approved_ietf_stream', u'ballot_approved_ietf_stream_cc', u'ballot_approved_ietf_stream_iana', u'ballot_deferred', u'ballot_saved', u'ballot_saved_cc']:
338+
for slug in [u'ballot_approved_charter', u'ballot_approved_charter_cc', u'ballot_approved_conflrev', u'ballot_approved_conflrev_cc', u'ballot_approved_ietf_stream', u'ballot_approved_ietf_stream_cc', u'ballot_approved_ietf_stream_iana', u'ballot_approved_status_change', u'ballot_approved_status_change_cc', u'ballot_deferred', u'ballot_saved', u'ballot_saved_cc']:
339339
m = MailToken.objects.create(slug=slug,desc=slug)
340340
m.recipients=[recipient]
341341

0 commit comments

Comments
 (0)