fix: cleaner search_result_row diff links for recent drafts replacing other drafts
This commit is contained in:
parent
4d440853c7
commit
9e4166393d
|
@ -512,12 +512,7 @@ class DocumentInfo(models.Model):
|
|||
return list(set([x.target for x in self.all_relations_that_doc(relationship)]))
|
||||
|
||||
def replaces(self):
|
||||
return set([ d for r in self.related_that_doc("replaces") for d in r.docs.all() ])
|
||||
|
||||
def replaces_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()
|
||||
return self.related_that_doc("replaces")
|
||||
|
||||
def replaced_by(self):
|
||||
return set([ r.document for r in self.related_that("replaces") ])
|
||||
|
|
|
@ -110,7 +110,9 @@
|
|||
{% if doc.rev != "00" %}
|
||||
<a href="{{ rfcdiff_base_url }}?url2={{ doc.name }}-{{ doc.rev }}">
|
||||
{% elif doc.replaces %}
|
||||
<a href="{{ rfcdiff_base_url }}?url1={{ doc.replaces_name }}&url2={{ doc.name }}-{{ doc.rev }}">
|
||||
{% with first_replaces=doc.replaces|first %}
|
||||
<a href="{{ rfcdiff_base_url }}?url1={{ first_replaces.name }}&url2={{ doc.name }}-{{ doc.rev }}">
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if doc.type_id == "rfc" %}
|
||||
|
|
Loading…
Reference in a new issue