dont include the item being deleted in the list of related items

This commit is contained in:
Jamie Murphy 2023-09-08 00:33:42 +01:00
parent 1063db9470
commit 298a7860b2
No known key found for this signature in database
GPG Key ID: 10EDAE1E6D858F5F

View File

@ -341,7 +341,8 @@ class ObjectDeleteView(GetReturnURLMixin, BaseObjectView):
nested_objs = []
if collector.instances_with_model():
for model, instance in collector.instances_with_model():
nested_objs.append(f"{model.__name__} - {instance}")
if not instance == obj:
nested_objs.append(f"{model.__name__} - {instance}")
# If this is an HTMX request, return only the rendered deletion form as modal content