Skip to content

Custom fields of type 'object' don't work with 'empty' filter expression #20012

@llamafilm

Description

@llamafilm

Deployment Type

Self-hosted

NetBox Version

v4.3.2

Python Version

3.12

Steps to Reproduce

  1. Create a custom field called 'location_served' with type 'object (location)' and filter logic 'exact' and object types 'device'. (We use this when a device serves a room other than where it's physically located, for example an AV Closet next to a screening room.)
  2. Add some values to this custom field on a few devices.
  3. Try to filter /dcim/devices/?cf_location_served__empty=true

Expected Behavior

Since the custom field stores a numeric value, representing the ID of the linked object, it should respect all the numeric lookup expressions. Some expressions do work correctly, for example /dcim/devices/?cf_location_served__gt=18600.

Observed Behavior

It returns all objects, as if the filter were not present.

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions