-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
betaConcerns a bug/feature in a beta releaseConcerns a bug/feature in a beta releasestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.5.0-beta2
Python version
3.8
Steps to Reproduce
- Create a new ObjectWidget list with the Model "DCIM > Device".
- In the URL parameters filter by two different location_id's:
{
"location_id": 1,
"location_id": 2
}
- Save the widget
Expected Behavior
Widget should show devices belonging to either location with the id of 1 or 2.
Observed Behavior
Devices with location id 2 are shown. As the filters are passed as a JSON field and converted to a dict, it's not possible to have two entries with the same key. This is at odds with how the URL parameters are handled for multiselect fields, here the URL parameters would look like so:
?location_id=1&location_id=2
Passing the url parameters as a list also does not work:
{
"location_id": [1,2]
}
This cause of the issue is similar to #12270. I believe setting doseq=True when calling urlencode would allow the above syntax to work, that is passing a list of values for the key with multiple values.
Metadata
Metadata
Assignees
Labels
betaConcerns a bug/feature in a beta releaseConcerns a bug/feature in a beta releasestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application