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

Allow unassigning VRF and tenants when editing objects in bulk

This commit is contained in:
Jeremy Stretch
2016-07-28 15:59:49 -04:00
parent 6b41794e12
commit 397943b222
7 changed files with 70 additions and 41 deletions

View File

@ -159,7 +159,11 @@ class CircuitBulkEditView(PermissionRequiredMixin, BulkEditView):
def update_objects(self, pk_list, form):
fields_to_update = {}
for field in ['type', 'provider', 'tenant', 'port_speed', 'commit_rate', 'comments']:
if form.cleaned_data['tenant'] == 0:
fields_to_update['tenant'] = None
elif form.cleaned_data['tenant']:
fields_to_update['tenant'] = form.cleaned_data['tenant']
for field in ['type', 'provider', 'port_speed', 'commit_rate', 'comments']:
if form.cleaned_data[field]:
fields_to_update[field] = form.cleaned_data[field]