From cc1a43e5d9a3d30d45ccf49a428b7d3f093373ba Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 28 Dec 2020 11:10:27 -0500 Subject: [PATCH] Fixes #5533: Fix bulk editing of objects with required custom fields --- docs/release-notes/version-2.10.md | 1 + netbox/netbox/views/generic.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-2.10.md b/docs/release-notes/version-2.10.md index 0db155df5..82e4a07e0 100644 --- a/docs/release-notes/version-2.10.md +++ b/docs/release-notes/version-2.10.md @@ -7,6 +7,7 @@ * [#5301](https://github.com/netbox-community/netbox/issues/5301) - Fix misleading error when racking a device with invalid parameters * [#5311](https://github.com/netbox-community/netbox/issues/5311) - Update child objects when a rack group is moved to a new site * [#5518](https://github.com/netbox-community/netbox/issues/5518) - Fix persistent vertical scrollbar +* [#5533](https://github.com/netbox-community/netbox/issues/5533) - Fix bulk editing of objects with required custom fields * [#5540](https://github.com/netbox-community/netbox/issues/5540) - Fix exception when viewing a provider with one or more tags assigned * [#5543](https://github.com/netbox-community/netbox/issues/5543) - Fix rendering of config contexts with cluster assignment for devices diff --git a/netbox/netbox/views/generic.py b/netbox/netbox/views/generic.py index eb7b2542f..bd21d469c 100644 --- a/netbox/netbox/views/generic.py +++ b/netbox/netbox/views/generic.py @@ -798,8 +798,8 @@ class BulkEditView(GetReturnURLMixin, ObjectPermissionRequiredMixin, View): # Update custom fields for name in custom_fields: if name in form.nullable_fields and name in nullified_fields: - obj.custom_field_data.pop(name, None) - else: + obj.custom_field_data[name] = None + elif form.cleaned_data.get(name) not in (None, ''): obj.custom_field_data[name] = form.cleaned_data[name] obj.full_clean()