Explorar o código

Add blank choice to ColorSelect widget

Jeremy Stretch %!s(int64=7) %!d(string=hai) anos
pai
achega
5e7fccb64e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      netbox/utilities/forms.py

+ 1 - 1
netbox/utilities/forms.py

@@ -209,7 +209,7 @@ class ColorSelect(forms.Select):
     option_template_name = 'widgets/colorselect_option.html'
 
     def __init__(self, *args, **kwargs):
-        kwargs['choices'] = COLOR_CHOICES
+        kwargs['choices'] = add_blank_choice(COLOR_CHOICES)
         super(ColorSelect, self).__init__(*args, **kwargs)