[PR #11343] [CLOSED] 10201 cable terminations2 #13771

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/11343
Author: @arthanson
Created: 12/30/2022
Status: Closed

Base: developHead: 10201-cable-terminations2


📝 Commits (8)

  • 1270bc8 10201 first fix and debugging prints
  • 8d37fb5 10201 more debug
  • a98984c Merge branch 'develop' into 10201-cable-terminations2
  • cc5f0c9 10201 fix add/remove termination
  • 9671307 10201 remove debugging code
  • 2074c8b 10201 add back deleted line
  • 4bee634 Merge branch 'develop' into 10201-cable-terminations2
  • 8c58e2b 10201 remove commented out lines

📊 Changes

3 files changed (+31 additions, -15 deletions)

View changed files

📝 netbox/dcim/models/device_components.py (+2 -2)
📝 netbox/dcim/signals.py (+27 -11)
📝 netbox/dcim/utils.py (+2 -2)

📄 Description

Fixes: #10201

Fix cable termination checks if edit and remove terminations.

@jeremystretch can you please double-check the logic here, not 100% sure if I'm missing any edge cases or anything. Note: the lines removed in signals.py for CableTermination delete:

    for cablepath in CablePath.objects.filter(_nodes__contains=instance.cable):
        cablepath.retrace()

This assumes that CableTermination can only be removed on a Cable save (which I believe is correct), so the path retrace is handled in the update_connected_endpoints signal and this is not needed here. If we can directly delete a CableTermination without going through Cable save then this would be an issue.


🔄 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/11343 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 12/30/2022 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `10201-cable-terminations2` --- ### 📝 Commits (8) - [`1270bc8`](https://github.com/netbox-community/netbox/commit/1270bc8818e563f491227432bc8ec299a78d3720) 10201 first fix and debugging prints - [`8d37fb5`](https://github.com/netbox-community/netbox/commit/8d37fb5eecea6d45f6a6224b6cd6d6dfb4c2ef40) 10201 more debug - [`a98984c`](https://github.com/netbox-community/netbox/commit/a98984cf9d222c933cae93147b0c6c1871e90eb7) Merge branch 'develop' into 10201-cable-terminations2 - [`cc5f0c9`](https://github.com/netbox-community/netbox/commit/cc5f0c9c28567b6a78c8c3b2b6fbd1b07a9f5bc7) 10201 fix add/remove termination - [`9671307`](https://github.com/netbox-community/netbox/commit/9671307a65c8ad0823b8ce97e16788b07a2b2c51) 10201 remove debugging code - [`2074c8b`](https://github.com/netbox-community/netbox/commit/2074c8b391ef87b79d6625de336137be188df90e) 10201 add back deleted line - [`4bee634`](https://github.com/netbox-community/netbox/commit/4bee634d7c3b7032726b20f10a74ba584ced064f) Merge branch 'develop' into 10201-cable-terminations2 - [`8c58e2b`](https://github.com/netbox-community/netbox/commit/8c58e2b70f4ec30c92501b42ef36f63377bcf2c4) 10201 remove commented out lines ### 📊 Changes **3 files changed** (+31 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/device_components.py` (+2 -2) 📝 `netbox/dcim/signals.py` (+27 -11) 📝 `netbox/dcim/utils.py` (+2 -2) </details> ### 📄 Description <!-- 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: #10201 <!-- Please include a summary of the proposed changes below. --> Fix cable termination checks if edit and remove terminations. @jeremystretch can you please double-check the logic here, not 100% sure if I'm missing any edge cases or anything. **Note:** the lines removed in signals.py for CableTermination delete: ``` for cablepath in CablePath.objects.filter(_nodes__contains=instance.cable): cablepath.retrace() ``` This assumes that CableTermination can only be removed on a Cable save (which I believe is correct), so the path retrace is handled in the update_connected_endpoints signal and this is not needed here. If we can directly delete a CableTermination without going through Cable save then this would be an issue. --- <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:20:43 +01:00
adam closed this issue 2025-12-29 23:20:43 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13771