[PR #18844] [MERGED] Fixes: #18582 Bulk import prefixes with associated VLAN not working when multiple VLANs with the same vid exist. #15453

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/18844
Author: @renatoalmeidaoliveira
Created: 3/8/2025
Status: Merged
Merged: 3/11/2025
Merged by: @jeremystretch

Base: mainHead: 18582-Bulk-import-prefixes-with-associated-VLAN


📝 Commits (2)

  • 3a2aa84 Add site CSVModelChoiceField
  • 51568d4 Change site field to vlan_site

📊 Changes

1 file changed (+13 additions, -6 deletions)

View changed files

📝 netbox/ipam/forms/bulk_import.py (+13 -6)

📄 Description

Fixes: #18582 Bulk import prefixes with associated VLAN not working when multiple VLANs with the same vid exist.

  • PrefixImportForm already implemented a test case for VLAN Site and VLANGroup code
  • Only a CSVModelChoiceField for vlan_group was implemented

The fix consisted in implementing a CSVModelChoiceField for Site

Aditional observations:

It should be possible to setup the VLAN queryset to the same as the Prefix scope if existent, but IMO that could lead to unwanted results, like:

  • User Creates a VLAN that doesn't belong to any Site, that VLAN gonna be missing in the queryset.

🔄 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/18844 **Author:** [@renatoalmeidaoliveira](https://github.com/renatoalmeidaoliveira) **Created:** 3/8/2025 **Status:** ✅ Merged **Merged:** 3/11/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `18582-Bulk-import-prefixes-with-associated-VLAN` --- ### 📝 Commits (2) - [`3a2aa84`](https://github.com/netbox-community/netbox/commit/3a2aa84a5defa6ed29bd1ebd9bf3451669ca839b) Add site CSVModelChoiceField - [`51568d4`](https://github.com/netbox-community/netbox/commit/51568d48be7525b7567342dad0285cd88299aa5b) Change site field to vlan_site ### 📊 Changes **1 file changed** (+13 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `netbox/ipam/forms/bulk_import.py` (+13 -6) </details> ### 📄 Description ### Fixes: #18582 Bulk import prefixes with associated VLAN not working when multiple VLANs with the same vid exist. - `PrefixImportForm` already implemented a test case for VLAN `Site` and `VLANGroup` [code](https://github.com/netbox-community/netbox/blob/29c25e39fce5b549d4d960bcc7a65379059855ac/netbox/ipam/forms/bulk_import.py#L222) - Only a `CSVModelChoiceField` for vlan_group was implemented The fix consisted in implementing a `CSVModelChoiceField` for `Site` Aditional observations: It should be possible to setup the `VLAN` queryset to the same as the Prefix scope if existent, but IMO that could lead to unwanted results, like: - User Creates a `VLAN` that doesn't belong to any `Site`, that `VLAN` gonna be missing in the queryset. --- <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:22:00 +01:00
adam closed this issue 2025-12-30 00:22:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15453