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

Fixes #13909: Ignore empty choices when populating dynamic choice fields from initial data

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

+ 1 - 1
netbox/utilities/forms/fields/dynamic.py

@@ -43,7 +43,7 @@ class DynamicMultipleChoiceField(forms.MultipleChoiceField):
 
         if data is not None:
             self.choices = [
-                choice for choice in self.choices if choice[0] in data
+                choice for choice in self.choices if choice[0] and choice[0] in data
             ]
 
         return bound_field