Fixes #21429: Add Cable cloning and fix "Create & Add Another" to preserve Termination Types #337

Closed
opened 2026-04-05 16:26:33 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pheus on 2/17/2026

Fixes: #21429

This PR fixes the “Create & Add Another” workflow for cables by ensuring the selected termination types are preserved.

To do this, it extends Cable.clone() to include the form-only fields required by get_cable_form() (termination type and the relevant parent selector fields for each end). This makes both “Clone” and “Create & Add Another” behave consistently, while intentionally not cloning the actual terminations (since those endpoints are already occupied).

I’ve added a small note in get_cable_form() to document that Cable.clone() mirrors its parent selector mapping to help keep these in sync going forward.
Thanks for reviewing!

*Originally created by @pheus on 2/17/2026* ### Fixes: #21429 This PR fixes the “Create & Add Another” workflow for cables by ensuring the selected termination types are preserved. To do this, it extends `Cable.clone()` to include the form-only fields required by `get_cable_form()` (termination type and the relevant parent selector fields for each end). This makes both **“Clone”** and **“Create & Add Another”** behave consistently, while intentionally **not** cloning the actual terminations (since those endpoints are already occupied). I’ve added a small note in `get_cable_form()` to document that `Cable.clone()` mirrors its parent selector mapping to help keep these in sync going forward. Thanks for reviewing!
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#337