Skip to content

Commit

Permalink
Fixes #14056: Record a pre-change snapshot when bulk editing objects …
Browse files Browse the repository at this point in the history
…via CSV
  • Loading branch information
jeremystretch committed Nov 29, 2023
1 parent 290aae5 commit 6a30029
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions netbox/netbox/views/generic/bulk_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ def create_and_update_objects(self, form, request):
form.add_error('data', f"Row {i}: Object with ID {object_id} does not exist")
raise ValidationError('')

# Take a snapshot for change logging
if instance.pk and hasattr(instance, 'snapshot'):
instance.snapshot()

# Instantiate the model form for the object
model_form_kwargs = {
'data': record,
Expand Down

0 comments on commit 6a30029

Please sign in to comment.