Skip to content

Commit 82591ad

Browse files
committed
Fixes #14056: Record a pre-change snapshot when bulk editing objects via CSV
1 parent 6dddb6c commit 82591ad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

netbox/netbox/views/generic/bulk_views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ def create_and_update_objects(self, form, request):
394394
form.add_error('data', f"Row {i}: Object with ID {object_id} does not exist")
395395
raise ValidationError('')
396396

397+
# Take a snapshot for change logging
398+
if instance.pk and hasattr(instance, 'snapshot'):
399+
instance.snapshot()
400+
397401
# Instantiate the model form for the object
398402
model_form_kwargs = {
399403
'data': record,

0 commit comments

Comments
 (0)