-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: 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.4
Python version
3.9
Steps to Reproduce
- Create a new widget
- Widget type "Object Counts"
- Models: DCIM > Device
- Object filters: { "manufacturer_id": ["1", "2"] }
(replace "1" and "2" with valid IDs in your environment)
- Check number of counted objects
Expected Behavior
I'd expect NetBox to take lists into account like shown above and just like the corresponding URL does: https://netbox.tld/dcim/devices/?manufacturer_id=1&manufacturer_id=2
As per #12742, Object Count filters employ standard UI filters rather than low-level queryset filters since v3.5.3. While this is a good design decision, queryset filters gave the ability to use logical OR filters. Since Object List filters take lists into account, I'd expect Object Count filters to do the same.
Observed Behavior
The number of counted objects is always equal to the number of all devices. Nothing will be filtered. The filter works if you use a single string and not a list, e.g. { "manufacturer_id": "1" }
This behaviour is not the case with Object Lists.
Metadata
Metadata
Assignees
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: 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