mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2025-08-09 08:05:08 +02:00
Implement fix for field 'filterable' that was broken. Added new custom field parameter 'filter_logic'
This commit is contained in:
@ -36,8 +36,11 @@ with open('/opt/netbox/initializers/custom_fields.yml', 'r') as stream:
|
||||
if cf_details.get('description', 0):
|
||||
custom_field.description = cf_details['description']
|
||||
|
||||
if cf_details.get('filterable', 0):
|
||||
custom_field.is_filterables = cf_details['filterable']
|
||||
# If no filter_logic is specified then it will default to 'Loose'
|
||||
if cf_details.get('filter_logic', 0):
|
||||
for choice_id, choice_text in CF_FILTER_CHOICES:
|
||||
if choice_text.lower() == cf_details['filter_logic']:
|
||||
custom_field.filter_logic = choice_id
|
||||
|
||||
if cf_details.get('label', 0):
|
||||
custom_field.label = cf_details['label']
|
||||
|
Reference in New Issue
Block a user