[PR #20708] [MERGED] Fixes #20699: Ensure proper ordering of changelog entries resulting from cascading deletions #16023

Closed
opened 2025-12-30 00:25:22 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20708
Author: @jeremystretch
Created: 10/28/2025
Status: Merged
Merged: 10/29/2025
Merged by: @bctiemann

Base: mainHead: 20699-changelog-ordering


📝 Commits (3)

  • 729b036 Fix errant update of objects being deleted via cascade
  • bbf1f61 Extend custom collector to force expected ordering of cascading deletions
  • d04c41d Add test for ordering of cascading deletions

📊 Changes

3 files changed (+81 additions, -21 deletions)

View changed files

📝 netbox/core/signals.py (+2 -7)
📝 netbox/core/tests/test_changelog.py (+67 -4)
📝 netbox/netbox/models/deletion.py (+12 -10)

📄 Description

Fixes: #20699

  • Alter the pre_delete signal handler to log updates to dependent objects only where cascading deletion is not in use
  • Extend our custom collector to pass null=False even for nullable ForeignKeys with on_delete=CASCADE

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/20708 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 10/28/2025 **Status:** ✅ Merged **Merged:** 10/29/2025 **Merged by:** [@bctiemann](https://github.com/bctiemann) **Base:** `main` ← **Head:** `20699-changelog-ordering` --- ### 📝 Commits (3) - [`729b036`](https://github.com/netbox-community/netbox/commit/729b0365e01958887c04ffa676e2ef3754f5d59f) Fix errant update of objects being deleted via cascade - [`bbf1f61`](https://github.com/netbox-community/netbox/commit/bbf1f6181d62e0ffa35aade8970152da19e95a15) Extend custom collector to force expected ordering of cascading deletions - [`d04c41d`](https://github.com/netbox-community/netbox/commit/d04c41d0f65d87d93b52757b0d8f21c7af5d103a) Add test for ordering of cascading deletions ### 📊 Changes **3 files changed** (+81 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/signals.py` (+2 -7) 📝 `netbox/core/tests/test_changelog.py` (+67 -4) 📝 `netbox/netbox/models/deletion.py` (+12 -10) </details> ### 📄 Description ### Fixes: #20699 - Alter the `pre_delete` signal handler to log updates to dependent objects only where cascading deletion is not in use - Extend our custom collector to pass `null=False` even for nullable ForeignKeys with `on_delete=CASCADE` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:25:22 +01:00
adam closed this issue 2025-12-30 00:25:22 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16023