[PR #20949] [MERGED] Fix on delete cascade entity order #16094

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20949
Author: @fanshan
Created: 12/8/2025
Status: Merged
Merged: 12/22/2025
Merged by: @jeremystretch

Base: mainHead: fix_on_delete_order


📝 Commits (2)

  • 605c61e Fix on delete cascade entity order
  • 6b0a0fd Revert unrelated and simplify changes

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 netbox/core/signals.py (+2 -2)

📄 Description

Hello,

Since #20708 relation with a on delete RESTRICT are not deleted in the proper order. Then the error violate not-null constraint occurs and breaks the delete cascade feature.

Fixes: #20948

This PR try to fix object on delete order when a relation was set with the action RESTRICT on delete event.


🔄 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/20949 **Author:** [@fanshan](https://github.com/fanshan) **Created:** 12/8/2025 **Status:** ✅ Merged **Merged:** 12/22/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `fix_on_delete_order` --- ### 📝 Commits (2) - [`605c61e`](https://github.com/netbox-community/netbox/commit/605c61ef5bcc820ac6aa216aade40e7cd07162d7) Fix on delete cascade entity order - [`6b0a0fd`](https://github.com/netbox-community/netbox/commit/6b0a0fd1071ae7826c79138af82ae543ab5109d2) Revert unrelated and simplify changes ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/signals.py` (+2 -2) </details> ### 📄 Description Hello, Since [#20708](https://github.com/netbox-community/netbox/pull/20708) relation with a on delete RESTRICT are not deleted in the proper order. Then the error `violate not-null constraint` occurs and breaks the delete cascade feature. <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #20948 This PR try to fix object on delete order when a relation was set with the action `RESTRICT` on delete event. --- <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:45 +01:00
adam closed this issue 2025-12-30 00:25:45 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16094