Skip to content

Commit ef2260e

Browse files
committed
New exlicit "Intended status changed" message
- Legacy-Id: 10061
1 parent 5c13bdd commit ef2260e

6 files changed

Lines changed: 48 additions & 4 deletions

File tree

ietf/doc/mails.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,20 @@ def email_last_call_expired(doc):
417417
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()),
418418
cc = addrs.cc)
419419

420+
def email_intended_status_changed(request, doc, text):
421+
(to,cc) = gather_address_lists('doc_intended_status_changed',doc=doc)
422+
423+
if not to:
424+
return
425+
426+
text = strip_tags(text)
427+
send_mail(request, to, None,
428+
"Intended Status for %s changed to %s" % (doc.file_tag(),doc.intended_std_level),
429+
"doc/mail/intended_status_changed_email.txt",
430+
dict(text=text,
431+
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()),
432+
cc=cc)
433+
420434
def email_comment(request, doc, comment):
421435
(to, cc) = gather_address_lists('doc_added_comment',doc=doc)
422436

ietf/doc/tests_draft.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,10 @@ def test_doc_change_intended_status(self):
789789
self.doc = Document.objects.get(name=self.docname)
790790
self.assertEqual(self.doc.intended_std_level_id,'bcp')
791791
self.assertEqual(len(outbox),messages_before+1)
792+
self.assertTrue('Intended Status ' in outbox[-1]['Subject'])
793+
self.assertTrue('mars-chairs@' in outbox[-1]['To'])
792794
self.assertTrue('ZpyQFGmA' in str(outbox[-1]))
795+
793796
self.assertTrue('ZpyQFGmA' in self.doc.latest_event(DocEvent,type='added_comment').desc)
794797

795798
def test_doc_change_telechat_date(self):

ietf/doc/views_draft.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from ietf.doc.mails import ( email_ad, email_pulled_from_rfc_queue, email_resurrect_requested,
2020
email_resurrection_completed, email_state_changed, email_stream_changed,
2121
email_stream_state_changed, email_stream_tags_changed, extra_automation_headers,
22-
generate_publication_request, email_adopted )
22+
generate_publication_request, email_adopted, email_intended_status_changed )
2323
from ietf.doc.utils import ( add_state_change_event, can_adopt_draft,
2424
get_tags_for_stream_id, nice_consensus,
2525
update_reminder, update_telechat, make_notify_changed_event, get_initial_notify,
@@ -449,8 +449,7 @@ def change_intention(request, name):
449449
doc.time = e.time
450450
doc.save()
451451

452-
# TODO: Build explicit changed_intended_publication_status
453-
email_state_changed(request, doc, email_desc,'doc_state_edited')
452+
email_intended_status_changed(request, doc, email_desc)
454453

455454
return HttpResponseRedirect(doc.get_absolute_url())
456455

ietf/mailtoken/migrations/0002_auto_20150809_1314.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,15 @@ def mt_factory(slug,desc,to_slugs,cc_slugs=[]):
792792
'doc_non_ietf_stream_manager',
793793
])
794794

795-
795+
mt_factory(slug='doc_intended_status_changed',
796+
desc="Recipients for a message when a document's intended publication status changes",
797+
to_slugs=['doc_authors',
798+
'doc_group_chairs',
799+
'doc_shepherd',
800+
'doc_group_responsible_directors',
801+
'doc_non_ietf_stream_manager',
802+
])
803+
796804
def forward(apps, schema_editor):
797805

798806
make_recipients(apps)

ietf/name/fixtures/names.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5043,6 +5043,21 @@
50435043
"model": "mailtoken.mailtoken",
50445044
"pk": "doc_iana_state_changed"
50455045
},
5046+
{
5047+
"fields": {
5048+
"cc": [],
5049+
"to": [
5050+
"doc_authors",
5051+
"doc_group_chairs",
5052+
"doc_group_responsible_directors",
5053+
"doc_non_ietf_stream_manager",
5054+
"doc_shepherd"
5055+
],
5056+
"desc": "Recipients for a message when a document's intended publication status changes"
5057+
},
5058+
"model": "mailtoken.mailtoken",
5059+
"pk": "doc_intended_status_changed"
5060+
},
50465061
{
50475062
"fields": {
50485063
"cc": [
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% autoescape off %}{{ text }}
2+
3+
The document can be found at
4+
ID Tracker URL: {{ url }}
5+
{% endautoescape %}

0 commit comments

Comments
 (0)