diff --git a/netbox/netbox/views/generic/object_views.py b/netbox/netbox/views/generic/object_views.py index 6168676031f..d9ac2e9ff84 100644 --- a/netbox/netbox/views/generic/object_views.py +++ b/netbox/netbox/views/generic/object_views.py @@ -381,7 +381,7 @@ def get(self, request, *args, **kwargs): return self._handle_protected_objects(obj, e.restricted_objects, request, e) # If this is an HTMX request, return only the rendered deletion form as modal content - if request.htmx: + if htmx_partial(request): viewname = get_viewname(self.queryset.model, action='delete') form_url = reverse(viewname, kwargs={'pk': obj.pk}) return render(request, 'htmx/delete_form.html', { diff --git a/netbox/templates/generic/object_delete.html b/netbox/templates/generic/object_delete.html index e453702123a..f5ce50ead6d 100644 --- a/netbox/templates/generic/object_delete.html +++ b/netbox/templates/generic/object_delete.html @@ -18,7 +18,7 @@ {% block content %}