mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #15608: Avoid caching values of null fields in search index
This commit is contained in:
@ -59,9 +59,10 @@ class SearchIndex:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def get_field_value(instance, field_name):
|
def get_field_value(instance, field_name):
|
||||||
"""
|
"""
|
||||||
Return the value of the specified model field as a string.
|
Return the value of the specified model field as a string (or None).
|
||||||
"""
|
"""
|
||||||
return str(getattr(instance, field_name))
|
if value := getattr(instance, field_name):
|
||||||
|
return str(value)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_category(cls):
|
def get_category(cls):
|
||||||
|
Reference in New Issue
Block a user