Override for table view

This commit is contained in:
zandercymatics 2024-03-04 10:28:44 -07:00
parent 73673abae1
commit ac1886a2b5
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 24 additions and 3 deletions

View file

@ -1339,6 +1339,9 @@ class DomainAdmin(ListHeaderAdmin):
# Table ordering
ordering = ["name"]
# Override for the delete confirmation page on the domain table (bulk delete action)
delete_selected_confirmation_template = "django/admin/domain_delete_selected_confirmation.html"
def delete_view(self, request, object_id, extra_context=None):
"""
Custom delete_view to perform additional actions or customize the template.
@ -1346,7 +1349,6 @@ class DomainAdmin(ListHeaderAdmin):
# Set the delete template to a custom one
self.delete_confirmation_template = "django/admin/domain_delete_confirmation.html"
response = super().delete_view(request, object_id, extra_context=extra_context)
return response