Merged in [16095] from peter@akayla.com:

Fixed bad calls to rfcdiff for -00 drafts and replaced drafts.  Fixes issue #2697.
 - Legacy-Id: 16117
Note: SVN reference [16095] has been migrated to Git commit cfdbae1f3c
This commit is contained in:
Henrik Levkowetz 2019-03-28 12:04:54 +00:00
commit 23d28bc0c3
3 changed files with 14 additions and 3 deletions

View file

@ -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") ])

View file

@ -59,9 +59,15 @@
<td>
<span class="text-nowrap">
{% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}<a href="{{ rfcdiff_base_url }}?url2={{ doc.name }}-{{ doc.rev }}">{% 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" %}</a>{% endif %}
{% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}
{% if doc.replaces %}<a href="{{ rfcdiff_base_url }}?url1={{ doc.replaces_canonical_name}}&url2={{ doc.name }}-{{ doc.rev }}">
{% elif doc.rev != "00" %}<a href="{{ rfcdiff_base_url }}?url2={{ doc.name }}-{{ doc.rev }}">{% 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 %}</a>{% endif %}
{% endif %}
</span>
{% for check in doc.submission.latest_checks %}

Binary file not shown.