Update related_objects.html

This commit is contained in:
Jonathan Senecal 2024-07-05 08:48:32 -04:00 committed by Jeremy Stretch
parent 420613daed
commit 8bea914163

View File

@ -5,7 +5,8 @@
<h5 class="card-header">{% trans "Related Objects" %}</h5>
<ul class="list-group list-group-flush">
{% for qs, filter_param in related_models %}
{% with viewname=qs.model|viewname:"list" %}
{% with viewname=qs.model|validated_viewname:"list" %}
{% if viewname is not None %}
<a href="{% url viewname %}?{{ filter_param }}={{ object.pk }}" class="list-group-item list-group-item-action d-flex justify-content-between">
{{ qs.model|meta:"verbose_name_plural"|bettertitle }}
{% with count=qs.count %}
@ -16,6 +17,7 @@
{% endif %}
{% endwith %}
</a>
{% endif %}
{% endwith %}
{% endfor %}
</ul>