Skip to content

Commit

Permalink
fix: Adjust IRTF charter approval email headers (#5917) (#6460)
Browse files Browse the repository at this point in the history
  • Loading branch information
pselkirk committed Oct 11, 2023
1 parent a02812b commit 16f9e0e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
15 changes: 14 additions & 1 deletion ietf/doc/tests_charter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright The IETF Trust 2011-2020, All Rights Reserved
# Copyright The IETF Trust 2011-2023, All Rights Reserved


import datetime
Expand Down Expand Up @@ -817,6 +817,19 @@ def test_approve(self):
self.assertEqual(group.groupmilestone_set.filter(state="active", desc=m1.desc).count(), 1)
self.assertEqual(group.groupmilestone_set.filter(state="active", desc=m4.desc).count(), 1)

def test_approve_irtf(self):
charter = CharterFactory(group__type_id='rg')
url = urlreverse('ietf.doc.views_charter.approve', kwargs=dict(name=charter.name))
login_testing_unauthorized(self, "secretary", url)
empty_outbox()
r = self.client.post(url, dict())
self.assertEqual(r.status_code, 302)
self.assertEqual(len(outbox), 2)
self.assertTrue("IRTF" in outbox[1]['From'])
self.assertTrue("irtf-announce" in outbox[1]['To'])
self.assertTrue(charter.group.acronym in outbox[1]['Cc'])
self.assertTrue("RG Action" in outbox[1]['Subject'])

def test_charter_with_milestones(self):
charter = CharterFactory()

Expand Down
26 changes: 26 additions & 0 deletions ietf/mailtrigger/migrations/0003_ballot_approved_charter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright The IETF Trust 2023, All Rights Reserved

from django.db import migrations

def forward(apps, schema_editor):
MailTrigger = apps.get_model("mailtrigger", "MailTrigger")
Recipient = apps.get_model("mailtrigger", "Recipient")
mt = MailTrigger.objects.get(pk="ballot_approved_charter")
mt.to.remove(mt.to.first())
mt.to.add(Recipient.objects.get(slug="group_stream_announce"))

def reverse(apps, schema_editor):
MailTrigger = apps.get_model("mailtrigger", "MailTrigger")
Recipient = apps.get_model("mailtrigger", "Recipient")
mt = MailTrigger.objects.get(pk="ballot_approved_charter")
mt.to.remove(mt.to.first())
mt.to.add(Recipient.objects.get(slug="ietf_announce"))

class Migration(migrations.Migration):
dependencies = [
("mailtrigger", "0002_slidesubmitter"),
]

operations = [
migrations.RunPython(forward, reverse)
]
2 changes: 1 addition & 1 deletion ietf/name/fixtures/names.json
Original file line number Diff line number Diff line change
Expand Up @@ -3770,7 +3770,7 @@
],
"desc": "Recipients when a charter is approved",
"to": [
"ietf_announce"
"group_stream_announce"
]
},
"model": "mailtrigger.mailtrigger",
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/doc/charter/action_text.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load ietf_filters %}{% autoescape off %}From: The IESG <iesg-secretary@ietf.org>
{% load ietf_filters %}{% autoescape off %}From: {% if group.type_id == "rg" %}The IRTF <irtf-chair@irtf.org>{% else %}The IESG <iesg-secretary@ietf.org>{% endif %}
To: {{ to }}{% if cc %}
Cc: {{ cc }} {% endif %}
Subject: {{ group.type.name }} Action: {{ action_type }} {{ group.name }} ({{ group.acronym }})
Expand Down

0 comments on commit 16f9e0e

Please sign in to comment.