1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #769: Show default value for boolean custom fields

This commit is contained in:
Jeremy Stretch
2017-01-04 09:47:26 -05:00
parent 96451bfe9e
commit 7f297b4733

View File

@ -34,9 +34,9 @@ def get_custom_fields_for_model(content_type, filterable_only=False, bulk_edit=F
(0, 'False'),
)
if cf.default.lower() in ['true', 'yes', '1']:
initial = True
initial = 1
elif cf.default.lower() in ['false', 'no', '0']:
initial = False
initial = 0
else:
initial = None
field = forms.NullBooleanField(required=cf.required, initial=initial,