mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Fixes #11232: Enable partial & regex matching for non-string types in global search
This commit is contained in:
parent
3675ad2539
commit
db5c2a379e
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## v3.4.2 (FUTURE)
|
## v3.4.2 (FUTURE)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* [#11232](https://github.com/netbox-community/netbox/issues/11232) - Enable partial & regular expression matching for non-string types in global search
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## v3.4.1 (2022-12-16)
|
## v3.4.1 (2022-12-16)
|
||||||
|
@ -99,8 +99,8 @@ class CachedValueSearchBackend(SearchBackend):
|
|||||||
params = {
|
params = {
|
||||||
f'value__{lookup}': value
|
f'value__{lookup}': value
|
||||||
}
|
}
|
||||||
if lookup != LookupTypes.EXACT:
|
if lookup in (LookupTypes.STARTSWITH, LookupTypes.ENDSWITH):
|
||||||
# Partial matches are valid only on string values
|
# Partial string matches are valid only on string values
|
||||||
params['type'] = FieldTypes.STRING
|
params['type'] = FieldTypes.STRING
|
||||||
if object_types:
|
if object_types:
|
||||||
params['object_type__in'] = object_types
|
params['object_type__in'] = object_types
|
||||||
|
Loading…
Reference in New Issue
Block a user