Fixes #5136: Fix exception when bulk editing interface 802.1Q mode

This commit is contained in:
Jeremy Stretch 2020-09-16 13:07:55 -04:00
parent e983f44fd3
commit 43f1fbf5b3
2 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@
* [#5111](https://github.com/netbox-community/netbox/issues/5111) - Allow use of tuples when specifying ObjectVar `query_params` * [#5111](https://github.com/netbox-community/netbox/issues/5111) - Allow use of tuples when specifying ObjectVar `query_params`
* [#5118](https://github.com/netbox-community/netbox/issues/5118) - Specifying an empty list of tags should clear assigned tags (REST API) * [#5118](https://github.com/netbox-community/netbox/issues/5118) - Specifying an empty list of tags should clear assigned tags (REST API)
* [#5133](https://github.com/netbox-community/netbox/issues/5133) - Fix disassociation of an IP address from a VM interface * [#5133](https://github.com/netbox-community/netbox/issues/5133) - Fix disassociation of an IP address from a VM interface
* [#5136](https://github.com/netbox-community/netbox/issues/5136) - Fix exception when bulk editing interface 802.1Q mode
--- ---

View File

@ -945,7 +945,7 @@ class BulkEditView(GetReturnURLMixin, ObjectPermissionRequiredMixin, View):
# ManyToManyFields # ManyToManyFields
elif isinstance(model_field, ManyToManyField): elif isinstance(model_field, ManyToManyField):
if form.cleaned_data[name].count() > 0: if form.cleaned_data[name]:
getattr(obj, name).set(form.cleaned_data[name]) getattr(obj, name).set(form.cleaned_data[name])
# Normal fields # Normal fields
elif form.cleaned_data[name] not in (None, ''): elif form.cleaned_data[name] not in (None, ''):