Fixes #21810: Prevent errors when viewing Device pages for Virtual Chassis Members #29

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

Originally created by @pheus on 4/1/2026

Fixes: #21810

This fixes a regression in the device detail view introduced during the UI layout migration.

VirtualChassisMembersPanel was building its add-device action from ctx['object'], but on the device view object is a Device, not a VirtualChassis. This change uses the panel's virtual_chassis context instead and checks for master_id before populating the default site and rack parameters, preventing an AttributeError when viewing a virtual chassis member that is not the master.

*Originally created by @pheus on 4/1/2026* ### Fixes: #21810 This fixes a regression in the device detail view introduced during the UI layout migration. `VirtualChassisMembersPanel` was building its add-device action from `ctx['object']`, but on the device view `object` is a `Device`, not a `VirtualChassis`. This change uses the panel's `virtual_chassis` context instead and checks for `master_id` before populating the default site and rack parameters, preventing an `AttributeError` when viewing a virtual chassis member that is not the master.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#29