Skip to content

Commit

Permalink
fix: send status change eval and lc to IANA. Fixes ietf-tools#3504. (i…
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsparks authored Jul 23, 2022
1 parent 57e729c commit de4f1fe
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
6 changes: 5 additions & 1 deletion ietf/doc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from ietf.name.models import SessionStatusName, BallotPositionName, DocTypeName
from ietf.person.models import Person
from ietf.person.factories import PersonFactory, EmailFactory
from ietf.utils.mail import outbox
from ietf.utils.mail import outbox, empty_outbox
from ietf.utils.test_utils import login_testing_unauthorized, unicontent, reload_db_objects
from ietf.utils.test_utils import TestCase
from ietf.utils.text import normalize_text
Expand Down Expand Up @@ -1665,11 +1665,15 @@ def test_document_ballot_needed_positions(self):
DocAlias.objects.create(name='rfc9999').docs.add(IndividualDraftFactory())
doc = DocumentFactory(type_id='statchg',name='status-change-imaginary-mid-review')
iesgeval_pk = str(State.objects.get(slug='iesgeval',type__slug='statchg').pk)
empty_outbox()
self.client.login(username='ad', password='ad+password')
r = self.client.post(urlreverse('ietf.doc.views_status_change.change_state',kwargs=dict(name=doc.name)),dict(new_state=iesgeval_pk))
self.assertEqual(r.status_code, 302)
r = self.client.get(r._headers["location"][1])
self.assertContains(r, ">IESG Evaluation<")
self.assertEqual(len(outbox), 2)
self.assertIn('iesg-secretary',outbox[0]['To'])
self.assertIn('drafts-eval',outbox[1]['To'])

doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9998'),relationship_id='tohist')
r = self.client.get(urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=doc.name)))
Expand Down
8 changes: 3 additions & 5 deletions ietf/doc/views_ballot.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,7 @@ def ballot_writeupnotes(request, name):
send_mail_preformatted(request, msg, override=override)

addrs = gather_address_lists('ballot_issued_iana',doc=doc).as_strings()
override={ "To": "IANA <%s>"%settings.IANA_EVAL_EMAIL, "Bcc": None , "Reply-To": []}
if addrs.cc:
override['CC'] = addrs.cc
override={ "To": addrs.to, "Bcc": None , "Reply-To": [], "CC": addrs.cc or None }
send_mail_preformatted(request, msg, extra=extra_automation_headers(doc), override=override)

e = DocEvent(doc=doc, rev=doc.rev, by=login)
Expand Down Expand Up @@ -1031,7 +1029,7 @@ def make_last_call(request, name):
announcement_event.save()

send_mail_preformatted(request, announcement)
if doc.type.slug == 'draft':
if doc.type.slug in ("draft", "statchg"):
addrs = gather_address_lists('last_call_issued_iana',doc=doc).as_strings(compact=False)
send_mail_preformatted(request, announcement, extra=extra_automation_headers(doc),
override={ "To": addrs.to, "CC": addrs.cc, "Bcc": None, "Reply-To": []})
Expand Down Expand Up @@ -1206,4 +1204,4 @@ def irsg_ballot_status(request):

docs.append(doc)

return render(request, 'doc/irsg_ballot_status.html', {'docs':docs})
return render(request, 'doc/irsg_ballot_status.html', {'docs':docs})
20 changes: 10 additions & 10 deletions ietf/doc/views_status_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,16 @@ def change_state(request, name, option=None):
))

def send_status_change_eval_email(request,doc):
msg = render_to_string("doc/eval_email.txt",
dict(doc=doc,
doc_url = settings.IDTRACKER_BASE_URL+doc.get_absolute_url(),
)
)
addrs = gather_address_lists('iesg_ballot_issued',doc=doc)
override = {'To':addrs.to }
if addrs.cc:
override['Cc'] = addrs.cc
send_mail_preformatted(request,msg,override=override)
for target in ('iesg_ballot_issued', 'ballot_issued_iana'):
addrs = gather_address_lists(target,doc=doc).as_strings()
msg = render_to_string("doc/eval_email.txt",
dict(doc=doc,
doc_url = settings.IDTRACKER_BASE_URL+doc.get_absolute_url(),
to = addrs.to,
cc = addrs.cc
)
)
send_mail_preformatted(request,msg)

class UploadForm(forms.Form):
content = forms.CharField(widget=forms.Textarea, label="Status change text", help_text="Edit the status change text.", required=False, strip=False)
Expand Down
1 change: 0 additions & 1 deletion ietf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,6 @@ def skip_unreadable_post(record):
# Email settings
IPR_EMAIL_FROM = '[email protected]'
AUDIO_IMPORT_EMAIL = ['[email protected]']
IANA_EVAL_EMAIL = "[email protected]"
SESSION_REQUEST_FROM_EMAIL = 'IETF Meeting Session Request Tool <[email protected]>'

SECRETARIAT_SUPPORT_EMAIL = "[email protected]"
Expand Down
6 changes: 3 additions & 3 deletions ietf/templates/doc/eval_email.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load mail_filters %}{% autoescape off %}To: {{to}} {% if cc %}
Cc: {{cc}}
{%endif%}From: IESG Secretary <[email protected]>
{% load mail_filters %}{% autoescape off %}To: {{to}}{% if cc %}
Cc: {{cc}}{%endif%}
From: IESG Secretary <[email protected]>
Reply-To: IESG Secretary <[email protected]>
Subject: Evaluation: {{doc.title}}

Expand Down

0 comments on commit de4f1fe

Please sign in to comment.