Webhook prechange snapshot missing when primary IP assigned or unassigned #8065

Closed
opened 2025-12-29 20:31:53 +01:00 by adam · 3 comments
Owner

Originally created by @AesoSpadez on GitHub (May 15, 2023).

Originally assigned to: @abhi1693 on GitHub.

NetBox version

v3.5.1

Python version

3.10

Steps to Reproduce

  1. Create a webhook - Content type DCIM > Device, events Updates, any URL, and the rest blank/defaults.
  2. Create a device (and all the prerequisite objects: Site, Role, Manufacturer, Type) - All defaults
  3. If no interfaces on the device type, add one.
  4. From the interfaces view of the device, add an IP address to the new interface - Check the 'Make this the primary' box.
  5. Go to the admin portal, find the webhook in the finished or failed jobs lists of the default queue.

Expected Behavior

The value of the prechange key of snapshots should have the prechange object data.

Observed Behavior

The value of the prechange key of snapshots is None.

Originally created by @AesoSpadez on GitHub (May 15, 2023). Originally assigned to: @abhi1693 on GitHub. ### NetBox version v3.5.1 ### Python version 3.10 ### Steps to Reproduce 1. Create a webhook - Content type `DCIM > Device`, events Updates, any URL, and the rest blank/defaults. 2. Create a device (and all the prerequisite objects: Site, Role, Manufacturer, Type) - All defaults 3. If no interfaces on the device type, add one. 4. From the interfaces view of the device, add an IP address to the new interface - Check the 'Make this the primary' box. 5. Go to the admin portal, find the webhook in the finished or failed jobs lists of the default queue. ### Expected Behavior The value of the prechange key of snapshots should have the prechange object data. ### Observed Behavior The value of the prechange key of snapshots is None.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:31:53 +01:00
adam closed this issue 2025-12-29 20:31:53 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (May 16, 2023):

I'm pretty sure parent.snapshot() should just be added after L360 here:

0ad88e2431/netbox/ipam/forms/model_forms.py (L354-L374)

Open for contributors, otherwise I'll take it when I get the time.

@kkthxbye-code commented on GitHub (May 16, 2023): I'm pretty sure `parent.snapshot()` should just be added after L360 here: https://github.com/netbox-community/netbox/blob/0ad88e24312c256ef0a3189c71009d5b8d97cdf5/netbox/ipam/forms/model_forms.py#L354-L374 Open for contributors, otherwise I'll take it when I get the time.
Author
Owner

@AesoSpadez commented on GitHub (May 16, 2023):

I've been meaning to get started contributing anyways and this seems about as straight-forward a change as one could hope for. I can take a shot at a PR if you want to assign the issue to me.

@AesoSpadez commented on GitHub (May 16, 2023): I've been meaning to get started contributing anyways and this seems about as straight-forward a change as one could hope for. I can take a shot at a PR if you want to assign the issue to me.
Author
Owner

@arthanson commented on GitHub (May 16, 2023):

Sounds good @AesoSpadez assigning it to you.

@arthanson commented on GitHub (May 16, 2023): Sounds good @AesoSpadez assigning it to you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8065