mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 14:23:36 -06:00
Override isnull lookup for custom fields
This commit is contained in:
parent
e01125a2ad
commit
004bb69aa1
@ -600,6 +600,10 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
|||||||
kwargs = {
|
kwargs = {
|
||||||
'field_name': f'custom_field_data__{self.name}'
|
'field_name': f'custom_field_data__{self.name}'
|
||||||
}
|
}
|
||||||
|
# Native numeric filters will use `isnull` by default for empty lookups, but
|
||||||
|
# JSON fields require `empty` (see bug #20012).
|
||||||
|
if lookup_expr == 'isnull':
|
||||||
|
lookup_expr = 'empty'
|
||||||
if lookup_expr is not None:
|
if lookup_expr is not None:
|
||||||
kwargs['lookup_expr'] = lookup_expr
|
kwargs['lookup_expr'] = lookup_expr
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user