mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 04:42:22 -06:00
Fixes #8314: Prevent custom fields with default values from appearing as applied filters erroneously
This commit is contained in:
@@ -121,5 +121,5 @@ class CustomFieldModelFilterForm(FilterForm):
|
||||
)
|
||||
for cf in custom_fields:
|
||||
field_name = f'cf_{cf.name}'
|
||||
self.fields[field_name] = cf.to_form_field(set_initial=True, enforce_required=False)
|
||||
self.fields[field_name] = cf.to_form_field(set_initial=False, enforce_required=False)
|
||||
self.custom_field_filters.append(field_name)
|
||||
|
||||
@@ -239,7 +239,7 @@ class CustomField(ChangeLoggedModel):
|
||||
"""
|
||||
Return a form field suitable for setting a CustomField's value for an object.
|
||||
|
||||
set_initial: Set initial date for the field. This should be False when generating a field for bulk editing.
|
||||
set_initial: Set initial data for the field. This should be False when generating a field for bulk editing.
|
||||
enforce_required: Honor the value of CustomField.required. Set to False for filtering/bulk editing.
|
||||
for_csv_import: Return a form field suitable for bulk import of objects in CSV format.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user