From 43f1fbf5b33035bf972cce5e011b1ac1ecc3ba72 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 16 Sep 2020 13:07:55 -0400 Subject: [PATCH] Fixes #5136: Fix exception when bulk editing interface 802.1Q mode --- docs/release-notes/version-2.9.md | 1 + netbox/utilities/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.9.md b/docs/release-notes/version-2.9.md index 5472188ba..6e3919542 100644 --- a/docs/release-notes/version-2.9.md +++ b/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 --- diff --git a/netbox/utilities/views.py b/netbox/utilities/views.py index 079068648..5ae839eff 100644 --- a/netbox/utilities/views.py +++ b/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, ''):