Merged in [13205] from housley@vigilsec.com:

Check downref registry when producing Last Call text.  Fixes #2069.
 - Legacy-Id: 13210
Note: SVN reference [13205] has been migrated to Git commit aa7ed23cda
This commit is contained in:
Henrik Levkowetz 2017-04-12 21:24:33 +00:00
commit b4fd2b63a8
6 changed files with 25 additions and 7 deletions

View file

@ -148,7 +148,7 @@ def generate_last_call_announcement(request, doc):
else:
ipr_links = None
downrefs = [rel for rel in doc.relateddocument_set.all() if rel.is_downref()]
downrefs = [rel for rel in doc.relateddocument_set.all() if rel.is_downref() and not rel.is_approved_downref()]
addrs = gather_address_lists('last_call_issued',doc=doc).as_strings()
mail = render_to_string("doc/mail/last_call_announcement.txt",

View file

@ -494,6 +494,14 @@ class RelatedDocument(models.Model):
return None
def is_approved_downref(self):
if self.target.document.get_state().slug == 'rfc':
if RelatedDocument.objects.filter(relationship_id='downref-approval', target=self.target):
return "Approved Downref"
return False
class DocumentAuthor(models.Model):
document = models.ForeignKey('Document')
author = models.ForeignKey(Email, help_text="Email address used by author for submission")

View file

@ -753,7 +753,7 @@ class RegenerateLastCallTestCase(TestCase):
draft = Document.objects.get(name=draft.name)
lc_text = draft.latest_event(WriteupDocEvent, type="changed_last_call_text").text
self.assertTrue("Subject: Last Call" in lc_text)
self.assertFalse("contains normative down" in lc_text)
self.assertFalse("contains these normative down" in lc_text)
rfc = DocumentFactory.create(
stream_id='ise',
@ -768,6 +768,15 @@ class RegenerateLastCallTestCase(TestCase):
self.assertEqual(r.status_code, 200)
draft = Document.objects.get(name=draft.name)
lc_text = draft.latest_event(WriteupDocEvent, type="changed_last_call_text").text
self.assertTrue('contains these normative down' in lc_text)
self.assertTrue('rfc6666' in lc_text)
self.assertTrue('Independent Submission Editor stream' in lc_text)
self.assertTrue("contains these normative down" in lc_text)
self.assertTrue("rfc6666" in lc_text)
self.assertTrue("Independent Submission Editor stream" in lc_text)
draft.relateddocument_set.create(target=rfc.docalias_set.get(name='rfc6666'),relationship_id='downref-approval')
r = self.client.post(url, dict(regenerate_last_call_text="1"))
self.assertEqual(r.status_code, 200)
draft = Document.objects.get(name=draft.name)
lc_text = draft.latest_event(WriteupDocEvent, type="changed_last_call_text").text
self.assertFalse("contains these normative down" in lc_text)
self.assertFalse("rfc6666" in lc_text)

View file

@ -43,7 +43,7 @@ DATABASES = {
if TEST_CODE_COVERAGE_CHECKER and not TEST_CODE_COVERAGE_CHECKER._started: # pyflakes:ignore
TEST_CODE_COVERAGE_CHECKER.start() # pyflakes:ignore
NOMCOM_PUBLIC_KEYS_DIR=os.path.abspath("tmp-nomcom-public-keys-dir")
#NOMCOM_PUBLIC_KEYS_DIR=os.path.abspath("tmp-nomcom-public-keys-dir")
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'test/media/') # pyflakes:ignore
MEDIA_URL = '/test/media/'

View file

@ -36,6 +36,6 @@ No IPR declarations have been submitted directly on this I-D.
The document contains these normative downward references.
See RFC 3967 for additional information:
{% for ref in downrefs %} {{ref.target.document.canonical_name}}: {{ref.target.document.title}} ({{ref.target.document.std_level}} - {{ref.target.document.stream.desc}})
{% endfor %}Note that some of these references may already be listed in the acceptable Downref Registry.{%endif%}
{% endfor %}{%endif%}
{% endautoescape %}

View file

@ -7,6 +7,7 @@
# --- Add entries at the top ---
/personal/housley/6.48.2.dev0@13205
/personal/housley/6.48.2.dev0@13181
/personal/housley/6.37.2.dev0@12326