[PR #20937] [MERGED] Fixes #20560: Fix VLAN disambiguation in prefix bulk import #16091

Closed
opened 2025-12-30 00:25:44 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20937
Author: @jnovinger
Created: 12/5/2025
Status: Merged
Merged: 12/12/2025
Merged by: @bctiemann

Base: mainHead: 20560-bulk-import-prefix


📝 Commits (1)

  • 9ae53fc Fixes #20560: Fix VLAN disambiguation in prefix bulk import

📊 Changes

2 files changed (+76 additions, -4 deletions)

View changed files

📝 netbox/ipam/forms/bulk_import.py (+0 -4)
📝 netbox/ipam/tests/test_views.py (+76 -0)

📄 Description

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

🔄 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/20937 **Author:** [@jnovinger](https://github.com/jnovinger) **Created:** 12/5/2025 **Status:** ✅ Merged **Merged:** 12/12/2025 **Merged by:** [@bctiemann](https://github.com/bctiemann) **Base:** `main` ← **Head:** `20560-bulk-import-prefix` --- ### 📝 Commits (1) - [`9ae53fc`](https://github.com/netbox-community/netbox/commit/9ae53fc23207664aece325dfebce960377e128f8) Fixes #20560: Fix VLAN disambiguation in prefix bulk import ### 📊 Changes **2 files changed** (+76 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `netbox/ipam/forms/bulk_import.py` (+0 -4) 📝 `netbox/ipam/tests/test_views.py` (+76 -0) </details> ### 📄 Description ### 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 --- <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-30 00:25:44 +01:00
adam closed this issue 2025-12-30 00:25:45 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16091