1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Cache custom fields on instance during bulk edit

This commit is contained in:
Jeremy Stretch
2020-08-17 12:29:40 -04:00
parent bc04543b33
commit ff5a3c1055

View File

@@ -949,6 +949,12 @@ class BulkEditView(GetReturnURLMixin, ObjectPermissionRequiredMixin, View):
elif form.cleaned_data[name] not in (None, ''): elif form.cleaned_data[name] not in (None, ''):
setattr(obj, name, form.cleaned_data[name]) setattr(obj, name, form.cleaned_data[name])
# Cache custom fields on instance prior to save()
if custom_fields:
obj._cf = {
name: form.cleaned_data[name] for name in custom_fields
}
obj.full_clean() obj.full_clean()
obj.save() obj.save()
updated_objects.append(obj) updated_objects.append(obj)