Skip to content

Commit 992aba1

Browse files
committed
Call out downreferences in autogenerated last call text. Fixes ietf-tools#1982. Commit ready for merge.
- Legacy-Id: 11654
1 parent b0880b3 commit 992aba1

4 files changed

Lines changed: 53 additions & 3 deletions

File tree

ietf/doc/mails.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def generate_last_call_announcement(request, doc):
120120
else:
121121
ipr_links = None
122122

123+
downrefs = [rel for rel in doc.relateddocument_set.all() if rel.is_downref()]
123124

124125
addrs = gather_address_lists('last_call_issued',doc=doc).as_strings()
125126
mail = render_to_string("doc/mail/last_call_announcement.txt",
@@ -132,6 +133,7 @@ def generate_last_call_announcement(request, doc):
132133
docs=[ doc ],
133134
urls=[ settings.IDTRACKER_BASE_URL + doc.get_absolute_url() ],
134135
ipr_links=ipr_links,
136+
downrefs=downrefs,
135137
)
136138
)
137139

ietf/doc/tests_ballot.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
from ietf.doc.models import ( Document, State, DocEvent, BallotDocEvent,
1010
BallotPositionDocEvent, LastCallDocEvent, WriteupDocEvent, TelechatDocEvent )
11+
from ietf.doc.factories import DocumentFactory
12+
from ietf.group.factories import GroupFactory
1113
from ietf.group.models import Group, Role
1214
from ietf.name.models import BallotPositionName
1315
from ietf.iesg.models import TelechatDate
@@ -713,3 +715,44 @@ def test_undefer_status_change(self):
713715

714716
def setUp(self):
715717
make_test_data()
718+
719+
class RegenerateLastCallTestCase(TestCase):
720+
721+
def test_regenerate_last_call(self):
722+
group = GroupFactory(type_id='individ')
723+
draft = DocumentFactory.create(stream_id='ietf',group=group)
724+
draft.docalias_set.create(name=draft.name) # factory should do this
725+
draft.set_state(State.objects.get(type='draft',slug='active'))
726+
draft.set_state(State.objects.get(type='draft-iesg',slug='pub-req'))
727+
draft.intended_std_level_id='ps'
728+
draft.save()
729+
730+
url = urlreverse('doc_ballot_lastcall', kwargs=dict(name=draft.name))
731+
login_testing_unauthorized(self, "secretary", url)
732+
r = self.client.get(url)
733+
self.assertEqual(r.status_code, 200)
734+
735+
r = self.client.post(url, dict(regenerate_last_call_text="1"))
736+
self.assertEqual(r.status_code, 200)
737+
draft = Document.objects.get(name=draft.name)
738+
lc_text = draft.latest_event(WriteupDocEvent, type="changed_last_call_text").text
739+
self.assertTrue("Subject: Last Call" in lc_text)
740+
self.assertFalse("contains normative down" in lc_text)
741+
742+
rfc = DocumentFactory.create(stream_id='ise')
743+
rfc.docalias_set.create(name=rfc.name)
744+
rfc_alias = rfc.docalias_set.create(name='rfc6666')
745+
rfc.set_state(State.objects.get(type='draft',slug='rfc'))
746+
rfc.set_state(State.objects.get(type='draft-iesg',slug='pub'))
747+
rfc.std_level_id='inf'
748+
rfc.save()
749+
750+
draft.relateddocument_set.create(target=rfc_alias,relationship_id='refnorm')
751+
752+
r = self.client.post(url, dict(regenerate_last_call_text="1"))
753+
self.assertEqual(r.status_code, 200)
754+
draft = Document.objects.get(name=draft.name)
755+
lc_text = draft.latest_event(WriteupDocEvent, type="changed_last_call_text").text
756+
self.assertTrue('contains these normative down' in lc_text)
757+
self.assertTrue('rfc6666' in lc_text)
758+
self.assertTrue('Independent Submission Editor stream' in lc_text)

ietf/templates/doc/ballot/lastcalltext.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h1>Last call text<br><small><a href="{% url "doc_view" name=doc.canonical_name
2626
{% if can_request_last_call and not need_intended_status %}
2727
<button type="submit" class="btn btn-primary" name="send_last_call_request" value="Save and Request Last Call">Save text &amp; request last call</button>
2828
{% endif %}
29-
<button type="submit" class="btn btn-warning" name="regenerate_last_call_text" value="Gegenerate Last Call Text">Regenerate text</button>
29+
<button type="submit" class="btn btn-warning" name="regenerate_last_call_text" value="Regenerate Last Call Text">Regenerate text</button>
3030
{% if user|has_role:"Secretariat" and can_make_last_call %}
3131
<a class="btn btn-primary" href="{% url "doc_make_last_call" name=doc.name %}">Issue last call</a>
3232
{% endif %}

ietf/templates/doc/mail/last_call_announcement.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,17 @@ The file{{ urls|pluralize }} can be obtained via
2525
IESG discussion can be tracked via
2626
{{ doc_url }}
2727

28-
{% if ipr_links %}
29-
The following IPR Declarations may be related to this I-D:
28+
{% if ipr_links %}The following IPR Declarations may be related to this I-D:
3029

3130
{% for link in ipr_links %} {{ link }}
3231
{% endfor %}
3332
{% else %}
3433
No IPR declarations have been submitted directly on this I-D.
3534
{% endif %}
35+
{% if downrefs %}
36+
The document contains these normative downward references.
37+
See RFC 3967 for additional information:
38+
{% for ref in downrefs %} {{ref.target.document.canonical_name}}: {{ref.target.document.title}} ({{ref.target.document.std_level}} - {{ref.target.document.stream.desc}})
39+
{% endfor %}Note that some of these references may already be listed in the acceptable Downref Registry.{%endif%}
40+
3641
{% endautoescape %}

0 commit comments

Comments
 (0)