Преглед изворни кода

CSVChoiceField should default to a blank string instead of None

Jeremy Stretch пре 6 година
родитељ
комит
b16be577e3
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      netbox/utilities/forms.py

+ 1 - 1
netbox/utilities/forms.py

@@ -432,7 +432,7 @@ class CSVChoiceField(forms.ChoiceField):
     def clean(self, value):
         value = super().clean(value)
         if not value:
-            return None
+            return ''
         if value not in self.choice_values:
             raise forms.ValidationError("Invalid choice: {}".format(value))
         return self.choice_values[value]