Skip to content

Commit

Permalink
fix: Deal with rfc doc types for references/referenced_by views
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards committed Jul 6, 2023
1 parent 9f1b05a commit fc284be
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions ietf/doc/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,20 @@ def references(self):
return self.relations_that_doc(('refnorm','refinfo','refunk','refold'))

def referenced_by(self):
return self.relations_that(('refnorm','refinfo','refunk','refold')).filter(source__states__type__slug='draft',source__states__slug__in=['rfc','active'])

return self.relations_that(("refnorm", "refinfo", "refunk", "refold")).filter(
models.Q(
source__type__slug="draft",
source__states__type__slug="draft",
source__states__slug="active",
)
| models.Q(source__type__slug="rfc")
)


def referenced_by_rfcs(self):
return self.relations_that(('refnorm','refinfo','refunk','refold')).filter(source__states__type__slug='draft',source__states__slug='rfc')
return self.relations_that(("refnorm", "refinfo", "refunk", "refold")).filter(
source__type__slug="rfc"
)

class Meta:
abstract = True
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/doc/document_referenced_by.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h1>References to {{ alias_name }}</h1>
</a>
</td>
<td>
{% if ref.source.get_state.slug == 'rfc' %}
{% if ref.source.type_id == "rfc" %}
{% with ref.source.std_level as lvl %}
{% if lvl %}{{ lvl }}{% endif %}
{% endwith %}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/doc/document_references.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h1>References from {{ doc.canonical_name }}</h1>
</a>
</td>
<td>
{% if ref.target.document.get_state.slug == 'rfc' %}
{% if ref.target.document.type_id == "rfc" %}
{% with ref.target.document.std_level as lvl %}
{% if lvl %}{{ lvl }}{% endif %}
{% endwith %}
Expand Down

0 comments on commit fc284be

Please sign in to comment.