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 #1830. Commit ready for merge.

- Legacy-Id: 10384
This commit is contained in:
Robert Sparks 2015-11-03 09:22:15 +00:00
parent bf0a5e3da4
commit be377e5ac5
3 changed files with 5 additions and 4 deletions

View file

@ -393,8 +393,8 @@ def email_adopted(request, doc, prev_state, new_state, by, comment=""):
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),
u'The %s %s has placed %s in state "%s"' %
(doc.group.acronym.upper(),doc.group.type_id.upper(), doc.name, new_state or "None"),
'doc/mail/doc_adopted_email.txt',
dict(doc=doc,
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),

View file

@ -1140,7 +1140,7 @@ 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("has adopted" in outbox[-1]["Subject"].lower())
self.assertTrue("Call For Adoption" in outbox[-1]["Subject"])
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'])

View file

@ -1,5 +1,6 @@
{% autoescape off %}{% filter wordwrap:73 %}
The {{ doc.group.acronym|upper }} {{ doc.group.type_id|upper }} has adopted {{ doc }} (entered by {{by}})
The {{ doc.group.acronym|upper }} {{ doc.group.type_id|upper }} has placed {{ doc }} in state
{{ new_state|default:'"None"'}} (entered by {{by}})
{% if prev_state %}The document was previously in state {{prev_state.name}}