Skip to content

Conversation

@pheus
Copy link
Contributor

@pheus pheus commented Oct 24, 2025

Fixes: #20646

Restricts creating cable terminations for endpoints flagged as "mark connected" to avoid the invalid state of being both virtually connected and physically cabled. The validation is implemented in dcim.CableTermination.clean(), ensuring consistent behavior across the UI, REST API, and CSV import. Includes a test covering the rejection case.

Summary of Changes

  • Add a guard in CableTermination.clean() to raise ValidationError when termination.mark_connected == True.
  • Keep the check generic so it applies to any cabled model exposing mark_connected (e.g., interfaces, power/power-feed ports, front/rear ports, circuit terminations).
  • Add test exercising:
    • rejection when the endpoint is mark_connected

Restricts cable connections to terminations flagged as "mark connected"
to avoid logical conflicts. Adds validation in the `Cable.clean()`
method and includes corresponding test cases to verify behavior.

Fixes netbox-community#20646
@pheus pheus marked this pull request as ready for review October 24, 2025 17:21
@jnovinger jnovinger requested review from a team and jnovinger and removed request for a team October 24, 2025 17:25
Copy link
Member

@jnovinger jnovinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @pheus

@jnovinger jnovinger merged commit d433a28 into netbox-community:main Oct 25, 2025
7 checks passed
@pheus pheus deleted the 20646-cable-mark-connected-validation branch October 25, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cable Bulk Uploads allow mark_connected AND a cable to be present (validation error)

2 participants