changelog does not retain object creation after it is deleted #5401

Closed
opened 2025-12-29 19:27:31 +01:00 by adam · 1 comment
Owner

Originally created by @michaeldialpad on GitHub (Sep 21, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.0.1

Python version

3.7

Steps to Reproduce

  1. create new prefix object
  2. validated CREATE changelog entry is present
  3. delete newly created prefix object
  4. validated DELETE changelog entry is present, but CREATE changelog entry is gone

Expected Behavior

I would expect changelog to keep previous change state if it is deleted

Observed Behavior

once object is deleted, changelog is gone

Originally created by @michaeldialpad on GitHub (Sep 21, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.0.1 ### Python version 3.7 ### Steps to Reproduce 1. create new prefix object 2. validated CREATE changelog entry is present 3. delete newly created prefix object 4. validated DELETE changelog entry is present, but CREATE changelog entry is gone ### Expected Behavior I would expect changelog to keep previous change state if it is deleted ### Observed Behavior once object is deleted, changelog is gone
adam added the type: bugstatus: accepted labels 2025-12-29 19:27:31 +01:00
adam closed this issue 2025-12-29 19:27:31 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 21, 2021):

Looks like this is a regression introduced in 88d2441ab3 when adding the changelog reverse relationship for GraphQL. Django forces a CASCADE action on this relationship when the related object is deleted. We can probably just omit the reverse relationship from the model and make the forward query directly within the GraphQL object.

Thanks for the report!

@jeremystretch commented on GitHub (Sep 21, 2021): Looks like this is a regression introduced in 88d2441ab377ddac17ecf59028fa07623f97f2ab when adding the `changelog` reverse relationship for GraphQL. Django forces a `CASCADE` action on this relationship when the related object is deleted. We can probably just omit the reverse relationship from the model and make the forward query directly within the GraphQL object. Thanks for the report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5401