Skip to content

Commit

Permalink
Fixes netbox-community#732: Allow custom select field values to be de…
Browse files Browse the repository at this point in the history
…selected if the field is not required
  • Loading branch information
jeremystretch committed Dec 7, 2016
1 parent 35d0856 commit e1baa21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/extras/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_custom_fields_for_model(content_type, filterable_only=False, bulk_edit=F
# Select
elif cf.type == CF_TYPE_SELECT:
choices = [(cfc.pk, cfc) for cfc in cf.choices.all()]
if bulk_edit or filterable_only:
if not cf.required or bulk_edit or filterable_only:
choices = [(None, '---------')] + choices
field = forms.TypedChoiceField(choices=choices, coerce=int, required=cf.required)

Expand Down

0 comments on commit e1baa21

Please sign in to comment.