Parcourir la source

Fixes #769: Show default value for boolean custom fields

Jeremy Stretch il y a 8 ans
Parent
commit
7f297b4733
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      netbox/extras/forms.py

+ 2 - 2
netbox/extras/forms.py

@@ -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,