[PR #16384] [MERGED] Fixes: #15016 - Catch AssertionError from cable trace and throw ValidationError #14842

Closed
opened 2025-12-29 23:27:03 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/16384
Author: @DanSheps
Created: 6/3/2024
Status: Merged
Merged: 3/4/2025
Merged by: @arthanson

Base: mainHead: 15016-fix-assertionerror-when-saving-cable


📝 Commits (10+)

  • 47f3994 Catch AssertionError from cable trace and throw ValidationError
  • 7c913fe Change to translation strings
  • 7f48651 Convert from assertions to conditionals and raise exception directly.
  • d4d4e50 Update CablePath to throw a "UnsupportedCablePath" exception instead of a validation error.
  • 9dc56a7 Merge branch 'develop' into 15016-fix-assertionerror-when-saving-cable
  • b528804 Revert object_views change and change to catch AbortRequest
  • 01529af Merge branch 'develop' of https://github.com/netbox-community/netbox into 15016-fix-assertionerror-when-saving-cable
  • 5be9af8 Merge remote-tracking branch 'origin/15016-fix-assertionerror-when-saving-cable' into 15016-fix-assertionerror-when-saving-cable
  • c574b5a Fix failed test
  • cb99654 Fix missed catch exception in test files

📊 Changes

4 files changed (+34 additions, -15 deletions)

View changed files

netbox/dcim/exceptions.py (+2 -0)
📝 netbox/dcim/models/cables.py (+23 -12)
📝 netbox/dcim/tests/test_cablepaths.py (+3 -2)
📝 netbox/wireless/signals.py (+6 -1)

📄 Description

Fixes: #15016 - Catch AssertionError from cable trace and throw ValidationError

  • Catch any assertion errors thrown by the Cable save signal and raise a validation error
  • Catch validation error in ObjectEditView and report error in UI while re-rendering form

🔄 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/16384 **Author:** [@DanSheps](https://github.com/DanSheps) **Created:** 6/3/2024 **Status:** ✅ Merged **Merged:** 3/4/2025 **Merged by:** [@arthanson](https://github.com/arthanson) **Base:** `main` ← **Head:** `15016-fix-assertionerror-when-saving-cable` --- ### 📝 Commits (10+) - [`47f3994`](https://github.com/netbox-community/netbox/commit/47f3994f933ddede4521a4981adbf92e72b4482d) Catch AssertionError from cable trace and throw ValidationError - [`7c913fe`](https://github.com/netbox-community/netbox/commit/7c913fecb7cec53ef84fc19796b759dca4c18ef4) Change to translation strings - [`7f48651`](https://github.com/netbox-community/netbox/commit/7f486517cc947847987ef43340acf70b8739cac2) Convert from assertions to conditionals and raise exception directly. - [`d4d4e50`](https://github.com/netbox-community/netbox/commit/d4d4e5058b1490cb7f04ea170c621cb0d3b87068) Update CablePath to throw a "UnsupportedCablePath" exception instead of a validation error. - [`9dc56a7`](https://github.com/netbox-community/netbox/commit/9dc56a70366c5042f4d901fbaf4283216c92b1e7) Merge branch 'develop' into 15016-fix-assertionerror-when-saving-cable - [`b528804`](https://github.com/netbox-community/netbox/commit/b528804b34b65ff1bf9c02bebfb63ac859249e2c) Revert object_views change and change to catch AbortRequest - [`01529af`](https://github.com/netbox-community/netbox/commit/01529afad53e286bf4806997028fe98724b6a2a7) Merge branch 'develop' of https://github.com/netbox-community/netbox into 15016-fix-assertionerror-when-saving-cable - [`5be9af8`](https://github.com/netbox-community/netbox/commit/5be9af813525c74e3a6f29bb141c704b51cafed8) Merge remote-tracking branch 'origin/15016-fix-assertionerror-when-saving-cable' into 15016-fix-assertionerror-when-saving-cable - [`c574b5a`](https://github.com/netbox-community/netbox/commit/c574b5a6138ac9034a0edb14f38f7ec4674f52db) Fix failed test - [`cb99654`](https://github.com/netbox-community/netbox/commit/cb99654636245cb32992af2c1cb2e126987795e5) Fix missed catch exception in test files ### 📊 Changes **4 files changed** (+34 additions, -15 deletions) <details> <summary>View changed files</summary> ➕ `netbox/dcim/exceptions.py` (+2 -0) 📝 `netbox/dcim/models/cables.py` (+23 -12) 📝 `netbox/dcim/tests/test_cablepaths.py` (+3 -2) 📝 `netbox/wireless/signals.py` (+6 -1) </details> ### 📄 Description ### Fixes: #15016 - Catch AssertionError from cable trace and throw ValidationError * Catch any assertion errors thrown by the Cable save signal and raise a validation error * Catch validation error in ObjectEditView and report error in UI while re-rendering form --- <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 23:27:03 +01:00
adam closed this issue 2025-12-29 23:27:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14842