Fixed bad calls to rfcdiff for -00 drafts and replaced drafts. Fixes issue #2697. Commit ready for merge.
- Legacy-Id: 16095
This commit is contained in:
parent
7224e06f3d
commit
cfdbae1f3c
|
@ -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") ])
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in a new issue