mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
some items were not showing (eg ips on devices)
This commit is contained in:
parent
b81d462976
commit
1063db9470
@ -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):
|
||||
|
@ -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 %}
|
||||
|
Loading…
Reference in New Issue
Block a user