Fixes #20560: Fix VLAN disambiguation in prefix bulk import #770

Closed
opened 2026-04-05 17:32:55 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jnovinger on 12/5/2025

Fixes: #20560

When vlan_site is specified during prefix bulk import, the form should only match VLANs at that specific site. The previous implementation included VLANs with NULL site (global VLANs), which caused "multiple objects were found" errors when both a global VLAN and site-specific VLAN existed with the same vid.

  • Removed NULL site inclusion from PrefixImportForm.__init__
  • Added regression tests for disambiguation between site-specific VLANs and between global/site-specific VLANs
  • Completes the fix started in PR #18844 which added the vlan_site field but inadvertently carried forward the NULL inclusion bug
*Originally created by @jnovinger on 12/5/2025* ### Fixes: #20560 When `vlan_site` is specified during prefix bulk import, the form should only match VLANs at that specific site. The previous implementation included VLANs with `NULL` site (global VLANs), which caused "multiple objects were found" errors when both a global VLAN and site-specific VLAN existed with the same vid. - Removed NULL site inclusion from `PrefixImportForm.__init__` - Added regression tests for disambiguation between site-specific VLANs and between global/site-specific VLANs - Completes the fix started in PR #18844 which added the `vlan_site` field but inadvertently carried forward the NULL inclusion bug
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#770