mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
17178 review changes
This commit is contained in:
parent
83793de408
commit
78e0a5af3f
@ -339,6 +339,15 @@ class ContactBulkEditView(generic.BulkEditView):
|
||||
table = tables.ContactTable
|
||||
form = forms.ContactBulkEditForm
|
||||
|
||||
def post_save_operations(self, form, obj):
|
||||
super().post_save_operations(form, obj)
|
||||
|
||||
# Add/remove groups
|
||||
if form.cleaned_data.get('add_groups', None):
|
||||
obj.groups.add(*form.cleaned_data['add_groups'])
|
||||
if form.cleaned_data.get('remove_groups', None):
|
||||
obj.groups.remove(*form.cleaned_data['remove_groups'])
|
||||
|
||||
|
||||
@register_model_view(Contact, 'bulk_delete', path='delete', detail=False)
|
||||
class ContactBulkDeleteView(generic.BulkDeleteView):
|
||||
@ -400,15 +409,6 @@ class ContactAssignmentBulkEditView(generic.BulkEditView):
|
||||
table = tables.ContactAssignmentTable
|
||||
form = forms.ContactAssignmentBulkEditForm
|
||||
|
||||
def post_save_operations(self, form, obj):
|
||||
super().post_save_operations(form, obj)
|
||||
|
||||
# Add/remove groups
|
||||
if form.cleaned_data.get('add_groups', None):
|
||||
obj.groups.add(*form.cleaned_data['add_groups'])
|
||||
if form.cleaned_data.get('remove_groups', None):
|
||||
obj.groups.remove(*form.cleaned_data['remove_groups'])
|
||||
|
||||
|
||||
@register_model_view(ContactAssignment, 'bulk_delete', path='delete', detail=False)
|
||||
class ContactAssignmentBulkDeleteView(generic.BulkDeleteView):
|
||||
|
Loading…
Reference in New Issue
Block a user