some items were not showing (eg ips on devices)

This commit is contained in:
Jamie Murphy 2023-09-08 00:20:50 +01:00
parent b81d462976
commit 1063db9470
No known key found for this signature in database
GPG Key ID: 10EDAE1E6D858F5F
2 changed files with 7 additions and 6 deletions

View File

@ -338,10 +338,11 @@ class ObjectDeleteView(GetReturnURLMixin, BaseObjectView):
using = router.db_for_write(obj._meta.model)
collector = NestedObjects(using=using)
collector.collect([obj])
if collector.nested():
nested_objs = collector.nested()[1]
else:
nested_objs = []
nested_objs = []
if collector.instances_with_model():
for model, instance in collector.instances_with_model():
nested_objs.append(f"{model.__name__} - {instance}")
# If this is an HTMX request, return only the rendered deletion form as modal content
if is_htmx(request):

View File

@ -15,8 +15,8 @@
{% if nested_objs %}
<p>
This will cause deltion of the following related items: <br>
{% for nested_obj in nested_objs %}
{{ nested_obj }} <br>
{% for nested_obj in nested_objs %}
- {{ nested_obj }} <br>
{% endfor %}
</p>
{% endif %}