Skip to content

Commit be377e5

Browse files
committed
When a group gives a document a new group state (particularly for the first time), send a message that says what happened instead of simply "Adopted". Fixes ietf-tools#1830. Commit ready for merge.
- Legacy-Id: 10384
1 parent bf0a5e3 commit be377e5

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

ietf/doc/mails.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ def email_adopted(request, doc, prev_state, new_state, by, comment=""):
393393
state_type = (prev_state or new_state).type
394394

395395
send_mail(request, to, settings.DEFAULT_FROM_EMAIL,
396-
u"The %s %s has adopted %s" %
397-
(doc.group.acronym.upper(),doc.group.type_id.upper(), doc.name),
396+
u'The %s %s has placed %s in state "%s"' %
397+
(doc.group.acronym.upper(),doc.group.type_id.upper(), doc.name, new_state or "None"),
398398
'doc/mail/doc_adopted_email.txt',
399399
dict(doc=doc,
400400
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),

ietf/doc/tests_draft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ def test_adopt_document(self):
11401140
self.assertEqual(draft.docevent_set.count() - events_before, 5)
11411141
self.assertEqual(draft.notify,"aliens@example.mars")
11421142
self.assertEqual(len(outbox), mailbox_before + 1)
1143-
self.assertTrue("has adopted" in outbox[-1]["Subject"].lower())
1143+
self.assertTrue("Call For Adoption" in outbox[-1]["Subject"])
11441144
self.assertTrue("mars-chairs@ietf.org" in outbox[-1]['To'])
11451145
self.assertTrue("draft-ietf-mars-test@" in outbox[-1]['To'])
11461146
self.assertTrue("mars-wg@" in outbox[-1]['To'])

ietf/templates/doc/mail/doc_adopted_email.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% autoescape off %}{% filter wordwrap:73 %}
2-
The {{ doc.group.acronym|upper }} {{ doc.group.type_id|upper }} has adopted {{ doc }} (entered by {{by}})
2+
The {{ doc.group.acronym|upper }} {{ doc.group.type_id|upper }} has placed {{ doc }} in state
3+
{{ new_state|default:'"None"'}} (entered by {{by}})
34

45
{% if prev_state %}The document was previously in state {{prev_state.name}}
56

0 commit comments

Comments
 (0)