Site selection in Prefix creation dialog does not limit VLAN group selection #6234

Closed
opened 2025-12-29 19:38:20 +01:00 by adam · 2 comments
Owner

Originally created by @stephanblanke on GitHub (Mar 19, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.1.10-dev

Python version

3.9

Steps to Reproduce

  1. Open the prefix creation form
  2. Under "Site/VLAN Assignment" select a site from the list
  3. Open selection menu for VLAN Group

Expected Behavior

Selecting a site from the list should limit the available VLAN Groups, that can be selected from the list.

Observed Behavior

Selecting a site from the list has no impact on the list of available VLAN Groups.

Originally created by @stephanblanke on GitHub (Mar 19, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.1.10-dev ### Python version 3.9 ### Steps to Reproduce 1. Open the prefix creation form 2. Under "Site/VLAN Assignment" select a site from the list 3. Open selection menu for VLAN Group ### Expected Behavior Selecting a site from the list should limit the available VLAN Groups, that can be selected from the list. ### Observed Behavior Selecting a site from the list has no impact on the list of available VLAN Groups.
adam added the type: bugstatus: accepted labels 2025-12-29 19:38:20 +01:00
adam closed this issue 2025-12-29 19:38:20 +01:00
Author
Owner

@stephanblanke commented on GitHub (Mar 19, 2022):

I think the bug is here:
f64987d0c4/netbox/ipam/forms/models.py (L219-L230)

Changing site_id to scope_id (line 225) and ading scope_type = 'dcim.site' (before line 226) would work, but in that case VLAN groups that are not assigned to a specific site would not be displayed anymore. I am unsure, if that would be the desired behaviour.

@stephanblanke commented on GitHub (Mar 19, 2022): I think the bug is here: https://github.com/netbox-community/netbox/blob/f64987d0c4ddef473f997bfa71c8bca3d6adbf09/netbox/ipam/forms/models.py#L219-L230 Changing `site_id` to `scope_id` (line 225) and ading `scope_type = 'dcim.site'` (before line 226) would work, but in that case VLAN groups that are not assigned to a specific site would not be displayed anymore. I am unsure, if that would be the desired behaviour.
Author
Owner

@jeremystretch commented on GitHub (Mar 22, 2022):

Close; site_id should be site. Thanks for the report!

@jeremystretch commented on GitHub (Mar 22, 2022): Close; `site_id` should be `site`. Thanks for the report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6234