Query for advanced object selector does not use query_params defined on input #18727
Labels
pending closure
Requires immediate attention to avoid being closed for inactivity
severity: low
Does not significantly disrupt application functionality, or a workaround is available
status: needs owner
This issue is tentatively accepted pending a volunteer committed to its implementation
type: bug
A confirmed report of unexpected behavior in the application
Uh oh!
There was an error while loading. Please reload this page.
Deployment Type
NetBox Cloud
NetBox Version
v4.2.4
Python Version
3.12
Steps to Reproduce
Create two Sites and attempt to create a Virtual Machine scoped to conflicting Sites for fields site and cluster.
Expected Behavior
User should be unable to assign "My Cluster" because the Cluster is scoped to "My Site" and the Virtual Machine is scoped to "Your Site".
The
query_params
defined on the Virtual Machine's cluster input should prevent this:netbox/netbox/virtualization/forms/model_forms.py
Lines 187 to 189 in beb0aff
Observed Behavior
While the cluster input itself does filter out the "My Cluster" option, selecting the Advanced Object Selector allows the selection of "My Cluster". Attempting to create the Virtual Machine scoped to the "My Cluster" Cluster returns an error:
The scope of this issue is currently limited to form inputs that utilize both the
selector=True
andquery_params={...}
attributes. But with the acceptance of issues #18138 and #17944 this could be impactful to user-defined scripts and custom fields.The text was updated successfully, but these errors were encountered: