Skip to content

Commit b4fd2b6

Browse files
committed
Merged in [13205] from housley@vigilsec.com:
Check downref registry when producing Last Call text. Fixes ietf-tools#2069. - Legacy-Id: 13210 Note: SVN reference [13205] has been migrated to Git commit aa7ed23
2 parents 7e3ee06 + aa7ed23 commit b4fd2b6

6 files changed

Lines changed: 25 additions & 7 deletions

File tree

ietf/doc/mails.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def generate_last_call_announcement(request, doc):
148148
else:
149149
ipr_links = None
150150

151-
downrefs = [rel for rel in doc.relateddocument_set.all() if rel.is_downref()]
151+
downrefs = [rel for rel in doc.relateddocument_set.all() if rel.is_downref() and not rel.is_approved_downref()]
152152

153153
addrs = gather_address_lists('last_call_issued',doc=doc).as_strings()
154154
mail = render_to_string("doc/mail/last_call_announcement.txt",

ietf/doc/models.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,14 @@ def is_downref(self):
494494

495495
return None
496496

497+
def is_approved_downref(self):
498+
499+
if self.target.document.get_state().slug == 'rfc':
500+
if RelatedDocument.objects.filter(relationship_id='downref-approval', target=self.target):
501+
return "Approved Downref"
502+
503+
return False
504+
497505
class DocumentAuthor(models.Model):
498506
document = models.ForeignKey('Document')
499507
author = models.ForeignKey(Email, help_text="Email address used by author for submission")

ietf/doc/tests_ballot.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ def test_regenerate_last_call(self):
753753
draft = Document.objects.get(name=draft.name)
754754
lc_text = draft.latest_event(WriteupDocEvent, type="changed_last_call_text").text
755755
self.assertTrue("Subject: Last Call" in lc_text)
756-
self.assertFalse("contains normative down" in lc_text)
756+
self.assertFalse("contains these normative down" in lc_text)
757757

758758
rfc = DocumentFactory.create(
759759
stream_id='ise',
@@ -768,6 +768,15 @@ def test_regenerate_last_call(self):
768768
self.assertEqual(r.status_code, 200)
769769
draft = Document.objects.get(name=draft.name)
770770
lc_text = draft.latest_event(WriteupDocEvent, type="changed_last_call_text").text
771-
self.assertTrue('contains these normative down' in lc_text)
772-
self.assertTrue('rfc6666' in lc_text)
773-
self.assertTrue('Independent Submission Editor stream' in lc_text)
771+
self.assertTrue("contains these normative down" in lc_text)
772+
self.assertTrue("rfc6666" in lc_text)
773+
self.assertTrue("Independent Submission Editor stream" in lc_text)
774+
775+
draft.relateddocument_set.create(target=rfc.docalias_set.get(name='rfc6666'),relationship_id='downref-approval')
776+
777+
r = self.client.post(url, dict(regenerate_last_call_text="1"))
778+
self.assertEqual(r.status_code, 200)
779+
draft = Document.objects.get(name=draft.name)
780+
lc_text = draft.latest_event(WriteupDocEvent, type="changed_last_call_text").text
781+
self.assertFalse("contains these normative down" in lc_text)
782+
self.assertFalse("rfc6666" in lc_text)

ietf/settings_sqlitetest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __getitem__(self, item):
4343
if TEST_CODE_COVERAGE_CHECKER and not TEST_CODE_COVERAGE_CHECKER._started: # pyflakes:ignore
4444
TEST_CODE_COVERAGE_CHECKER.start() # pyflakes:ignore
4545

46-
NOMCOM_PUBLIC_KEYS_DIR=os.path.abspath("tmp-nomcom-public-keys-dir")
46+
#NOMCOM_PUBLIC_KEYS_DIR=os.path.abspath("tmp-nomcom-public-keys-dir")
4747

4848
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'test/media/') # pyflakes:ignore
4949
MEDIA_URL = '/test/media/'

ietf/templates/doc/mail/last_call_announcement.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ No IPR declarations have been submitted directly on this I-D.
3636
The document contains these normative downward references.
3737
See RFC 3967 for additional information:
3838
{% 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%}
39+
{% endfor %}{%endif%}
4040

4141
{% endautoescape %}

ready-for-merge

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# --- Add entries at the top ---
99

10+
/personal/housley/6.48.2.dev0@13205
1011
/personal/housley/6.48.2.dev0@13181
1112

1213
/personal/housley/6.37.2.dev0@12326

0 commit comments

Comments
 (0)