Skip to content

Commit 0db4092

Browse files
committed
Fixes #7321: Don't overwrite multi-select custom fields during bulk edit
1 parent 41dfdc0 commit 0db4092

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/release-notes/version-3.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Bug Fixes
66

7+
* [#7321](https://github.com/netbox-community/netbox/issues/7321) - Don't overwrite multi-select custom fields during bulk edit
78
* [#7324](https://github.com/netbox-community/netbox/issues/7324) - Fix TypeError exception in web UI when filtering objects using single-choice filters
89

910
## v3.0.3 (2021-09-20)

netbox/netbox/views/generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,14 +824,14 @@ def post(self, request, **kwargs):
824824
if form.cleaned_data[name]:
825825
getattr(obj, name).set(form.cleaned_data[name])
826826
# Normal fields
827-
elif form.cleaned_data[name] not in (None, '', []):
827+
elif name in form.changed_data:
828828
setattr(obj, name, form.cleaned_data[name])
829829

830830
# Update custom fields
831831
for name in custom_fields:
832832
if name in form.nullable_fields and name in nullified_fields:
833833
obj.custom_field_data[name] = None
834-
elif form.cleaned_data.get(name) not in (None, ''):
834+
elif name in form.changed_data:
835835
obj.custom_field_data[name] = form.cleaned_data[name]
836836

837837
obj.full_clean()

0 commit comments

Comments
 (0)