From cfdbae1f3cbaa573530249f4aeca54e1096cb043 Mon Sep 17 00:00:00 2001 From: "Peter E. Yee" Date: Sat, 23 Mar 2019 18:17:51 +0000 Subject: [PATCH] Fixed bad calls to rfcdiff for -00 drafts and replaced drafts. Fixes issue #2697. Commit ready for merge. - Legacy-Id: 16095 --- ietf/doc/models.py | 5 +++++ ietf/templates/doc/search/search_result_row.html | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ietf/doc/models.py b/ietf/doc/models.py index 6541010d1..47d0fa81f 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -465,6 +465,11 @@ class DocumentInfo(models.Model): def replaces(self): return set([ r.document for r in self.related_that_doc("replaces")]) + def replaces_canonical_name(self): + s = set([ r.document for r in self.related_that_doc("replaces")]) + first = list(s)[0] if s else None + return None if first is None else first.filename_with_rev() + def replaced_by(self): return set([ r.document for r in self.related_that("replaces") ]) diff --git a/ietf/templates/doc/search/search_result_row.html b/ietf/templates/doc/search/search_result_row.html index 4302556b9..773bcbaaa 100644 --- a/ietf/templates/doc/search/search_result_row.html +++ b/ietf/templates/doc/search/search_result_row.html @@ -59,9 +59,15 @@ - {% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}{% endif %} - {% if doc.get_state_slug == "rfc" %}{{ doc.latest_revision_date|date:"Y-m" }}{% else %}{{ doc.latest_revision_date|date:"Y-m-d" }}{% endif %} - {% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}{% endif %} + + {% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %} + {% if doc.replaces %} + {% elif doc.rev != "00" %}{% endif %} + {% endif %} + {% if doc.get_state_slug == "rfc" %}{{ doc.latest_revision_date|date:"Y-m" }}{% else %}{{ doc.latest_revision_date|date:"Y-m-d" }}{% endif %} + {% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %} + {% if doc.rev != "00" or doc.replaces %}{% endif %} + {% endif %} {% for check in doc.submission.latest_checks %}