New exlicit "Intended status changed" message

- Legacy-Id: 10061
This commit is contained in:
Robert Sparks 2015-08-25 20:28:01 +00:00
parent 5c13bddd77
commit ef2260ea63
6 changed files with 48 additions and 4 deletions

View file

@ -417,6 +417,20 @@ def email_last_call_expired(doc):
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()),
cc = addrs.cc)
def email_intended_status_changed(request, doc, text):
(to,cc) = gather_address_lists('doc_intended_status_changed',doc=doc)
if not to:
return
text = strip_tags(text)
send_mail(request, to, None,
"Intended Status for %s changed to %s" % (doc.file_tag(),doc.intended_std_level),
"doc/mail/intended_status_changed_email.txt",
dict(text=text,
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()),
cc=cc)
def email_comment(request, doc, comment):
(to, cc) = gather_address_lists('doc_added_comment',doc=doc)

View file

@ -789,7 +789,10 @@ class IndividualInfoFormsTests(TestCase):
self.doc = Document.objects.get(name=self.docname)
self.assertEqual(self.doc.intended_std_level_id,'bcp')
self.assertEqual(len(outbox),messages_before+1)
self.assertTrue('Intended Status ' in outbox[-1]['Subject'])
self.assertTrue('mars-chairs@' in outbox[-1]['To'])
self.assertTrue('ZpyQFGmA' in str(outbox[-1]))
self.assertTrue('ZpyQFGmA' in self.doc.latest_event(DocEvent,type='added_comment').desc)
def test_doc_change_telechat_date(self):

View file

@ -19,7 +19,7 @@ from ietf.doc.models import ( Document, DocAlias, RelatedDocument, State,
from ietf.doc.mails import ( email_ad, email_pulled_from_rfc_queue, email_resurrect_requested,
email_resurrection_completed, email_state_changed, email_stream_changed,
email_stream_state_changed, email_stream_tags_changed, extra_automation_headers,
generate_publication_request, email_adopted )
generate_publication_request, email_adopted, email_intended_status_changed )
from ietf.doc.utils import ( add_state_change_event, can_adopt_draft,
get_tags_for_stream_id, nice_consensus,
update_reminder, update_telechat, make_notify_changed_event, get_initial_notify,
@ -449,8 +449,7 @@ def change_intention(request, name):
doc.time = e.time
doc.save()
# TODO: Build explicit changed_intended_publication_status
email_state_changed(request, doc, email_desc,'doc_state_edited')
email_intended_status_changed(request, doc, email_desc)
return HttpResponseRedirect(doc.get_absolute_url())

View file

@ -792,7 +792,15 @@ def make_mailtokens(apps):
'doc_non_ietf_stream_manager',
])
mt_factory(slug='doc_intended_status_changed',
desc="Recipients for a message when a document's intended publication status changes",
to_slugs=['doc_authors',
'doc_group_chairs',
'doc_shepherd',
'doc_group_responsible_directors',
'doc_non_ietf_stream_manager',
])
def forward(apps, schema_editor):
make_recipients(apps)

View file

@ -5043,6 +5043,21 @@
"model": "mailtoken.mailtoken",
"pk": "doc_iana_state_changed"
},
{
"fields": {
"cc": [],
"to": [
"doc_authors",
"doc_group_chairs",
"doc_group_responsible_directors",
"doc_non_ietf_stream_manager",
"doc_shepherd"
],
"desc": "Recipients for a message when a document's intended publication status changes"
},
"model": "mailtoken.mailtoken",
"pk": "doc_intended_status_changed"
},
{
"fields": {
"cc": [

View file

@ -0,0 +1,5 @@
{% autoescape off %}{{ text }}
The document can be found at
ID Tracker URL: {{ url }}
{% endautoescape %}