Skip to content

Commit e4af908

Browse files
committed
Merged in [15698] from rjsparks@nostrum.com:
Notify the RFC Editor when an RFC Editor note is changed after a draft has been approved. Fixes ietf-tools#2440. - Legacy-Id: 15729 Note: SVN reference [15698] has been migrated to Git commit 4337496
2 parents a21fa5d + 4337496 commit e4af908

6 files changed

Lines changed: 86 additions & 5 deletions

File tree

ietf/doc/tests_ballot.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,15 @@ def test_edit_ballot_rfceditornote(self):
395395
self.assertTrue("This is a note for the RFC Editor" in r.content)
396396

397397
# save with a note
398+
empty_outbox()
398399
r = self.client.post(url, dict(
399400
rfc_editor_note="This is a simple test.",
400401
save_ballot_rfceditornote="1"))
401402
self.assertEqual(r.status_code, 200)
402403
draft = Document.objects.get(name=draft.name)
403404
self.assertTrue(draft.has_rfc_editor_note())
404405
self.assertTrue("This is a simple test" in draft.latest_event(WriteupDocEvent, type="changed_rfc_editor_note_text").text)
406+
self.assertEqual(len(outbox), 0)
405407

406408
# clear the existing note
407409
r = self.client.post(url, dict(
@@ -411,6 +413,16 @@ def test_edit_ballot_rfceditornote(self):
411413
draft = Document.objects.get(name=draft.name)
412414
self.assertFalse(draft.has_rfc_editor_note())
413415

416+
# Add a note after the doc is approved
417+
empty_outbox()
418+
draft.set_state(State.objects.get(type='draft-iesg',slug='approved'))
419+
r = self.client.post(url, dict(
420+
rfc_editor_note='This is a new note.',
421+
save_ballot_rfceditornote="1"))
422+
self.assertEqual(r.status_code, 200)
423+
self.assertEqual(len(outbox),1)
424+
self.assertIn('RFC Editor note changed',outbox[-1]['Subject'])
425+
414426
def test_issue_ballot(self):
415427
ad = Person.objects.get(user__username="ad")
416428
for case in ('none','past','future'):

ietf/doc/views_ballot.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,19 @@ def ballot_rfceditornote(request, name):
683683
e.text = t.rstrip()
684684
e.save()
685685

686+
if doc.get_state_slug('draft-iesg') in ['approved', 'ann', 'rfcqueue']:
687+
(to, cc) = gather_address_lists('ballot_ednote_changed_late').as_strings()
688+
msg = render_to_string(
689+
'doc/ballot/ednote_changed_late.txt',
690+
context = dict(
691+
to = to,
692+
cc = cc,
693+
event = e,
694+
settings = settings,
695+
)
696+
)
697+
send_mail_preformatted(request, msg)
698+
686699
if request.method == 'POST' and "clear_ballot_rfceditornote" in request.POST:
687700
e = WriteupDocEvent(doc=doc, rev=doc.rev, by=login)
688701
e.by = login
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.16 on 2018-11-03 00:24
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
7+
def forward(apps, schema_editor):
8+
MailTrigger = apps.get_model('mailtrigger', 'MailTrigger')
9+
Recipient = apps.get_model('mailtrigger', 'Recipient')
10+
11+
changed = MailTrigger.objects.create(
12+
slug = 'ballot_ednote_changed_late',
13+
desc = 'Recipients when the RFC Editor note for a document is changed after the document has been approved',
14+
)
15+
changed.to.set(Recipient.objects.filter(slug__in=['rfc_editor','iesg']))
16+
17+
def reverse(apps, schema_editor):
18+
MailTrigger = apps.get_model('mailtrigger','MailTrigger')
19+
MailTrigger.objects.filter(slug='ballot_ednote_changed_late').delete()
20+
21+
class Migration(migrations.Migration):
22+
23+
dependencies = [
24+
('mailtrigger', '0003_add_review_notify_ad'),
25+
]
26+
27+
operations = [
28+
migrations.RunPython(forward, reverse)
29+
]

ietf/name/fixtures/names.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,18 @@
27532753
"model": "mailtrigger.mailtrigger",
27542754
"pk": "ballot_deferred"
27552755
},
2756+
{
2757+
"fields": {
2758+
"cc": [],
2759+
"desc": "Recipients when the RFC Editor note for a document is changed after the document has been approved",
2760+
"to": [
2761+
"iesg",
2762+
"rfc_editor"
2763+
]
2764+
},
2765+
"model": "mailtrigger.mailtrigger",
2766+
"pk": "ballot_ednote_changed_late"
2767+
},
27562768
{
27572769
"fields": {
27582770
"cc": [],
@@ -10503,7 +10515,7 @@
1050310515
"fields": {
1050410516
"command": "xym",
1050510517
"switch": "--version",
10506-
"time": "2018-11-02T00:08:27.707",
10518+
"time": "2018-11-05T00:08:25.451",
1050710519
"used": true,
1050810520
"version": "xym 0.4"
1050910521
},
@@ -10514,7 +10526,7 @@
1051410526
"fields": {
1051510527
"command": "pyang",
1051610528
"switch": "--version",
10517-
"time": "2018-11-02T00:08:28.485",
10529+
"time": "2018-11-05T00:08:26.227",
1051810530
"used": true,
1051910531
"version": "pyang 1.7.5"
1052010532
},
@@ -10525,7 +10537,7 @@
1052510537
"fields": {
1052610538
"command": "yanglint",
1052710539
"switch": "--version",
10528-
"time": "2018-11-02T00:08:28.661",
10540+
"time": "2018-11-05T00:08:26.434",
1052910541
"used": true,
1053010542
"version": "yanglint 0.14.80"
1053110543
},
@@ -10536,7 +10548,7 @@
1053610548
"fields": {
1053710549
"command": "xml2rfc",
1053810550
"switch": "--version",
10539-
"time": "2018-11-02T00:08:29.566",
10551+
"time": "2018-11-05T00:08:27.578",
1054010552
"used": true,
1054110553
"version": "xml2rfc 2.12.3"
1054210554
},

ietf/stats/utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def get_meeting_registration_data(meeting):
262262
person = emails.first().person
263263
# Create a new Person object
264264
else:
265+
try:
265266
# Normalize all-caps or all-lower entries. Don't touch
266267
# others, there might be names properly spelled with
267268
# internal uppercase letters.
@@ -310,7 +311,13 @@ def get_meeting_registration_data(meeting):
310311
if Email.objects.filter(person=person).count() == 1:
311312
email.primary = True
312313
email.save()
313-
314+
except:
315+
debug.show('first_name')
316+
debug.show('last_name')
317+
debug.show('regname')
318+
debug.show('user')
319+
debug.show('aliases')
320+
raise
314321
# update the person object to an actual value
315322
object.person = person
316323
object.save()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% load ietf_filters %}{% autoescape off %}To: {{to}}{% if cc %}
2+
Cc: {{cc}}{% endif %}
3+
Subject: RFC Editor note changed for {{event.doc}}
4+
5+
The RFC Editor note for {{event.doc}} has changed after the doc was approved.
6+
7+
The new note can be seen at {{settings.IDTRACKER_BASE_URL}}{% url 'ietf.doc.views_doc.document_writeup' name=event.doc.name %}
8+
{% endautoescape %}

0 commit comments

Comments
 (0)