소스 검색

Add blank choice to ColorSelect widget

Jeremy Stretch 7 년 전
부모
커밋
5e7fccb64e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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)