Преглед изворни кода

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

Jeremy Stretch пре 5 година
родитељ
комит
43f1fbf5b3
2 измењених фајлова са 2 додато и 1 уклоњено
  1. 1 0
      docs/release-notes/version-2.9.md
  2. 1 1
      netbox/utilities/views.py

+ 1 - 0
docs/release-notes/version-2.9.md

@@ -17,6 +17,7 @@
 * [#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)
 * [#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
 
 ---
 

+ 1 - 1
netbox/utilities/views.py

@@ -945,7 +945,7 @@ class BulkEditView(GetReturnURLMixin, ObjectPermissionRequiredMixin, View):
 
                                 # ManyToManyFields
                                 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])
                                 # Normal fields
                                 elif form.cleaned_data[name] not in (None, ''):