mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Fixes #14056: Record a pre-change snapshot when bulk editing objects via CSV
This commit is contained in:
parent
6dddb6c9d2
commit
82591ad8a1
@ -394,6 +394,10 @@ class BulkImportView(GetReturnURLMixin, BaseMultiObjectView):
|
|||||||
form.add_error('data', f"Row {i}: Object with ID {object_id} does not exist")
|
form.add_error('data', f"Row {i}: Object with ID {object_id} does not exist")
|
||||||
raise ValidationError('')
|
raise ValidationError('')
|
||||||
|
|
||||||
|
# Take a snapshot for change logging
|
||||||
|
if instance.pk and hasattr(instance, 'snapshot'):
|
||||||
|
instance.snapshot()
|
||||||
|
|
||||||
# Instantiate the model form for the object
|
# Instantiate the model form for the object
|
||||||
model_form_kwargs = {
|
model_form_kwargs = {
|
||||||
'data': record,
|
'data': record,
|
||||||
|
Loading…
Reference in New Issue
Block a user