[PR #3453] [MERGED] Fixes #3452: Queue deletion ObjectChanges until after response is sent #12564

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/3453
Author: @jeremystretch
Created: 8/26/2019
Status: Merged
Merged: 8/28/2019
Merged by: @jeremystretch

Base: developHead: 3452-change-logging


📝 Commits (1)

  • 6e66f8d Fixes #3452: Queue deletion ObjectChanges until after response is sent

📊 Changes

8 files changed (+77 additions, -106 deletions)

View changed files

📝 netbox/circuits/models.py (+7 -9)
📝 netbox/dcim/models.py (+18 -31)
📝 netbox/extras/middleware.py (+30 -39)
📝 netbox/extras/models.py (+4 -2)
📝 netbox/extras/tests/test_tags.py (+2 -2)
📝 netbox/extras/tests/test_views.py (+5 -5)
📝 netbox/ipam/models.py (+6 -12)
📝 netbox/utilities/models.py (+5 -6)

📄 Description

Fixes: #3452

  • Replaces log_change() with to_objectchange(). The later merely returns an unsaved ObjectChange object instead of saving it immediately.
  • Queue deletion ObjectChanges in the same manner as create/update ObjectChanges. This ensures that changes are recorded in chronological order, and allows us to easily purge the entire queue in the event of a transaction rollback.

🔄 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/3453 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 8/26/2019 **Status:** ✅ Merged **Merged:** 8/28/2019 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `3452-change-logging` --- ### 📝 Commits (1) - [`6e66f8d`](https://github.com/netbox-community/netbox/commit/6e66f8d68af687b8713b2003fcf0895bb47b800c) Fixes #3452: Queue deletion ObjectChanges until after response is sent ### 📊 Changes **8 files changed** (+77 additions, -106 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/models.py` (+7 -9) 📝 `netbox/dcim/models.py` (+18 -31) 📝 `netbox/extras/middleware.py` (+30 -39) 📝 `netbox/extras/models.py` (+4 -2) 📝 `netbox/extras/tests/test_tags.py` (+2 -2) 📝 `netbox/extras/tests/test_views.py` (+5 -5) 📝 `netbox/ipam/models.py` (+6 -12) 📝 `netbox/utilities/models.py` (+5 -6) </details> ### 📄 Description ### Fixes: #3452 * Replaces `log_change()` with `to_objectchange()`. The later merely returns an unsaved ObjectChange object instead of saving it immediately. * Queue deletion ObjectChanges in the same manner as create/update ObjectChanges. This ensures that changes are recorded in chronological order, and allows us to easily purge the entire queue in the event of a transaction rollback. --- <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-29 22:22:20 +01:00
adam closed this issue 2025-12-29 22:22:21 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12564