mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 20:22:53 -06:00
Fixes #769: Show default value for boolean custom fields
This commit is contained in:
parent
96451bfe9e
commit
7f297b4733
@ -34,9 +34,9 @@ def get_custom_fields_for_model(content_type, filterable_only=False, bulk_edit=F
|
|||||||
(0, 'False'),
|
(0, 'False'),
|
||||||
)
|
)
|
||||||
if cf.default.lower() in ['true', 'yes', '1']:
|
if cf.default.lower() in ['true', 'yes', '1']:
|
||||||
initial = True
|
initial = 1
|
||||||
elif cf.default.lower() in ['false', 'no', '0']:
|
elif cf.default.lower() in ['false', 'no', '0']:
|
||||||
initial = False
|
initial = 0
|
||||||
else:
|
else:
|
||||||
initial = None
|
initial = None
|
||||||
field = forms.NullBooleanField(required=cf.required, initial=initial,
|
field = forms.NullBooleanField(required=cf.required, initial=initial,
|
||||||
|
Loading…
Reference in New Issue
Block a user