Skip to content

Commit 62e7b51

Browse files
committed
Added stream change and state change emails in adopt_draft() -- otherwise we wouldn't have the state change emails assumed in the previous commit. See issue ietf-tools#1246.
- Legacy-Id: 7207
1 parent 41c1c1a commit 62e7b51

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

ietf/doc/tests_draft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ def test_adopt_document(self):
10101010
self.assertEqual(draft.stream_id, "ietf")
10111011
self.assertEqual(draft.docevent_set.count() - events_before, 4)
10121012
self.assertEqual(len(outbox), mailbox_before + 1)
1013-
self.assertTrue("adopted" in outbox[-1]["Subject"].lower())
1013+
self.assertTrue("state changed" in outbox[-1]["Subject"].lower())
10141014
self.assertTrue("marschairman@ietf.org" in unicode(outbox[-1]))
10151015
self.assertTrue("marsdelegate@ietf.org" in unicode(outbox[-1]))
10161016

ietf/doc/views_draft.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,10 @@ def adopt_draft(request, name):
13021302
if doc.stream:
13031303
e.desc += u" from %s" % doc.stream.name
13041304
e.save()
1305+
old_stream = doc.stream
13051306
doc.stream = new_stream
1307+
if old_stream != None:
1308+
email_stream_changed(request, doc, old_stream, new_stream)
13061309

13071310
# group
13081311
if group != doc.group:
@@ -1315,6 +1318,8 @@ def adopt_draft(request, name):
13151318

13161319
doc.save()
13171320

1321+
comment = form.cleaned_data["comment"].strip()
1322+
13181323
# state
13191324
prev_state = doc.get_state("draft-stream-%s" % doc.stream_id)
13201325
new_state = State.objects.get(slug=adopt_state_slug, type="draft-stream-%s" % doc.stream_id, used=True)
@@ -1328,8 +1333,9 @@ def adopt_draft(request, name):
13281333

13291334
update_reminder(doc, "stream-s", e, due_date)
13301335

1336+
email_stream_state_changed(request, doc, prev_state, new_state, by, comment)
1337+
13311338
# comment
1332-
comment = form.cleaned_data["comment"].strip()
13331339
if comment:
13341340
e = DocEvent(type="added_comment", time=doc.time, by=by, doc=doc)
13351341
e.desc = comment

0 commit comments

Comments
 (0)