fix: Deal with rfc doc types for references/referenced_by views
This commit is contained in:
parent
9f1b05a518
commit
fc284be6d8
|
@ -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
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in a new issue