fix: Deal with rfc doc types for references/referenced_by views

This commit is contained in:
Jennifer Richards 2023-07-06 17:33:04 -03:00
parent 9f1b05a518
commit fc284be6d8
No known key found for this signature in database
GPG key ID: 9B2BF5C5ADDA6A6E
3 changed files with 15 additions and 5 deletions

View file

@ -641,10 +641,20 @@ class DocumentInfo(models.Model):
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

View file

@ -64,7 +64,7 @@
</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 %}

View file

@ -51,7 +51,7 @@
</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 %}