1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Move component bulk delete views to new URLs

This commit is contained in:
Jeremy Stretch
2020-02-04 16:06:55 -05:00
parent fca347e49e
commit c1639b7781
7 changed files with 25 additions and 41 deletions

View File

@ -742,14 +742,12 @@ class BulkDeleteView(GetReturnURLMixin, View):
Delete objects in bulk.
queryset: Custom queryset to use when retrieving objects (e.g. to select related objects)
parent_model: The model of the parent object (if any)
filter: FilterSet to apply when deleting by QuerySet
table: The table used to display devices being deleted
form: The form class used to delete objects in bulk
template_name: The name of the template
"""
queryset = None
parent_model = None
filterset = None
table = None
form = None
@ -762,12 +760,6 @@ class BulkDeleteView(GetReturnURLMixin, View):
model = self.queryset.model
# Attempt to derive parent object if a parent class has been given
if self.parent_model:
parent_obj = get_object_or_404(self.parent_model, **kwargs)
else:
parent_obj = None
# Are we deleting *all* objects in the queryset or just a selected subset?
if request.POST.get('_all'):
if self.filterset is not None:
@ -809,7 +801,6 @@ class BulkDeleteView(GetReturnURLMixin, View):
return render(request, self.template_name, {
'form': form,
'parent_obj': parent_obj,
'obj_type_plural': model._meta.verbose_name_plural,
'table': table,
'return_url': self.get_return_url(request),