ArnesSI / netbox-inventory

Manage your hardware inventory in NetBox
MIT License
215 stars 21 forks source link

Filtering by None/null device on asset endpoint yields ValueError #197

Open sylvia-cs opened 1 month ago

sylvia-cs commented 1 month ago

Netbox Version

v3.4.8

Issue

Selecting ‘None’ option for device in /assets endpoint triggers ValueError on Netbox side. Attempted workaround by setting installed_device_name=null in request also fails with empty results (appears to be searching for string "null" rather than value null). Screenshot 2024-09-25 at 3 27 51 PM Screenshot 2024-09-25 at 3 28 01 PM Screenshot 2024-09-25 at 3 30 09 PM

matejv commented 1 month ago

Thank you for reporting this. For now you can use Is assigned to hardware : No filter to get only assets that aren't installed for example.

But the issues should be fixed, I agree. The logic for filtering assets on installed device, location, site, etc. has gotten quite complex, so I'll have to take a bit more time to fix this.

Note to self: all filters that use query_located() need to be checked.