Skip to content

Commit f18e069

Browse files
committed
Merged in [9505] from rjsparks@nostrum.com:
Add a checkbox to cc the group list address on ballot positions if a document belongs to a group. Add better tests of the checkboxes on that form. - Legacy-Id: 9506 Note: SVN reference [9505] has been migrated to Git commit b84d4d3
2 parents 66b46ef + b84d4d3 commit f18e069

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

ietf/doc/tests_ballot.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def test_send_ballot_comment(self):
152152
# send
153153
mailbox_before = len(outbox)
154154

155-
r = self.client.post(url, dict(cc="test@example.com", cc_state_change="1"))
155+
r = self.client.post(url, dict(cc="test@example.com", cc_state_change="1",cc_group_list="1"))
156156
self.assertEqual(r.status_code, 302)
157157

158158
self.assertEqual(len(outbox), mailbox_before + 1)
@@ -162,6 +162,17 @@ def test_send_ballot_comment(self):
162162
self.assertTrue(draft.name in m['Subject'])
163163
self.assertTrue("clearer title" in str(m))
164164
self.assertTrue("Test!" in str(m))
165+
self.assertTrue("somebody@example.com" in m['Cc'])
166+
self.assertTrue("test@example.com" in m['Cc'])
167+
self.assertTrue(draft.group.list_email)
168+
self.assertTrue(draft.group.list_email in m['Cc'])
169+
170+
r = self.client.post(url, dict(cc=""))
171+
self.assertEqual(r.status_code, 302)
172+
self.assertEqual(len(outbox), mailbox_before + 2)
173+
m = outbox[-1]
174+
self.assertEqual(m['Cc'],None)
175+
165176

166177
class BallotWriteupsTests(TestCase):
167178
def test_edit_last_call_text(self):

ietf/doc/views_ballot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ def send_ballot_comment(request, name, ballot_id):
290290
cc = [x.strip() for x in request.POST.get("cc", "").split(',') if x.strip()]
291291
if request.POST.get("cc_state_change") and doc.notify:
292292
cc.extend(doc.notify.split(','))
293+
if request.POST.get("cc_group_list") and doc.group.list_email:
294+
cc.append(doc.group.list_email)
293295

294296
send_mail_text(request, to, frm, subject, body, cc=u", ".join(cc))
295297

ietf/templates/doc/ballot/send_ballot_comment.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ <h1>Send ballot position for {{ ad }}</h1>
3737
</div>
3838
{% endif %}
3939

40+
{% if doc.group.list_email %}
41+
<div class="checkbox">
42+
<label>
43+
<input type="checkbox" name="cc_group_list" value="1" checked>
44+
<b>Cc:</b> {{ doc.group.list_email }}
45+
</label>
46+
</div>
47+
{% endif %}
48+
4049
<div class="form-group">
4150
<label>Subject</label>
4251
<input class="form-control" type="text" placeholder="{{ subject }}" disabled>

0 commit comments

Comments
 (0)