New explicit "Document has been adopted by group" message
- Legacy-Id: 10059
This commit is contained in:
parent
e5a6ab4385
commit
9d239843e6
|
@ -417,6 +417,24 @@ def email_last_call_expired(doc):
|
|||
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()),
|
||||
cc = addrs.cc)
|
||||
|
||||
def email_adopted(request, doc, prev_state, new_state, by, comment=""):
|
||||
(to, cc) = gather_address_lists('doc_adopted_by_group',doc=doc)
|
||||
|
||||
state_type = (prev_state or new_state).type
|
||||
|
||||
send_mail(request, to, settings.DEFAULT_FROM_EMAIL,
|
||||
u"The %s %s has adopted %s" %
|
||||
(doc.group.acronym.upper(),doc.group.type_id.upper(), doc.name),
|
||||
'doc/mail/doc_adopted_email.txt',
|
||||
dict(doc=doc,
|
||||
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),
|
||||
state_type=state_type,
|
||||
prev_state=prev_state,
|
||||
new_state=new_state,
|
||||
by=by,
|
||||
comment=comment),
|
||||
cc=cc)
|
||||
|
||||
def email_stream_state_changed(request, doc, prev_state, new_state, by, comment=""):
|
||||
(to, cc)= gather_address_lists('doc_stream_state_edited',doc=doc)
|
||||
|
||||
|
|
|
@ -1135,9 +1135,10 @@ class AdoptDraftTests(TestCase):
|
|||
self.assertEqual(draft.docevent_set.count() - events_before, 5)
|
||||
self.assertEqual(draft.notify,"aliens@example.mars")
|
||||
self.assertEqual(len(outbox), mailbox_before + 1)
|
||||
self.assertTrue("state changed" in outbox[-1]["Subject"].lower())
|
||||
self.assertTrue("mars-chairs@ietf.org" in unicode(outbox[-1]))
|
||||
self.assertTrue("marsdelegate@ietf.org" in unicode(outbox[-1]))
|
||||
self.assertTrue("has adopted" in outbox[-1]["Subject"].lower())
|
||||
self.assertTrue("mars-chairs@ietf.org" in outbox[-1]['To'])
|
||||
self.assertTrue("draft-ietf-mars-test@" in outbox[-1]['To'])
|
||||
self.assertTrue("mars-wg@" in outbox[-1]['To'])
|
||||
|
||||
self.assertFalse(mars.list_email in draft.notify)
|
||||
|
||||
|
|
|
@ -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 )
|
||||
generate_publication_request, email_adopted )
|
||||
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,
|
||||
|
@ -1301,8 +1301,7 @@ def adopt_draft(request, name):
|
|||
|
||||
update_reminder(doc, "stream-s", e, due_date)
|
||||
|
||||
# TODO: Replace this with a message that's explicitly about the document adoption
|
||||
email_stream_state_changed(request, doc, prev_state, new_state, by, comment)
|
||||
email_adopted(request, doc, prev_state, new_state, by, comment)
|
||||
|
||||
# comment
|
||||
if comment:
|
||||
|
|
|
@ -771,6 +771,18 @@ def make_mailtokens(apps):
|
|||
'iesg_secretary',
|
||||
])
|
||||
|
||||
mt_factory(slug='doc_adopted_by_group',
|
||||
desc="Recipients for notification that a document has been adopted by a group",
|
||||
to_slugs=['doc_authors',
|
||||
'doc_group_chairs',
|
||||
'doc_group_mail_list',
|
||||
],
|
||||
cc_slugs=['doc_ad',
|
||||
'doc_shepherd',
|
||||
'doc_notify',
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def forward(apps, schema_editor):
|
||||
|
||||
|
|
|
@ -4961,6 +4961,23 @@
|
|||
"model": "mailtoken.mailtoken",
|
||||
"pk": "conflrev_requested_iana"
|
||||
},
|
||||
{
|
||||
"fields": {
|
||||
"cc": [
|
||||
"doc_ad",
|
||||
"doc_notify",
|
||||
"doc_shepherd"
|
||||
],
|
||||
"to": [
|
||||
"doc_authors",
|
||||
"doc_group_chairs",
|
||||
"doc_group_mail_list"
|
||||
],
|
||||
"desc": "Recipients for notification that a document has been adopted by a group"
|
||||
},
|
||||
"model": "mailtoken.mailtoken",
|
||||
"pk": "doc_adopted_by_group"
|
||||
},
|
||||
{
|
||||
"fields": {
|
||||
"cc": [
|
||||
|
|
10
ietf/templates/doc/mail/doc_adopted_email.txt
Normal file
10
ietf/templates/doc/mail/doc_adopted_email.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% autoescape off %}{% filter wordwrap:73 %}
|
||||
The {{ doc.group.acronym|upper }} {{ doc.group.type_id|upper }} has adopted {{ doc }} (entered by {{by}})
|
||||
|
||||
{% if prev_state %}The document was previously in state {{prev_state.name}}
|
||||
|
||||
{% endif %}The document is available at {{ url }}
|
||||
{% if comment %}
|
||||
|
||||
Comment:
|
||||
{{ comment }}{% endif %}{% endfilter %}{% endautoescape %}
|
Loading…
Reference in a new issue