瀏覽代碼

Updated clean method on DynamicModelMultipleChoiceField to return the name.

Julio-Oliveira-Encora 2 年之前
父節點
當前提交
6c51b89502
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      netbox/utilities/forms/fields/dynamic.py

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

@@ -197,6 +197,6 @@ class DynamicModelMultipleChoiceField(DynamicModelChoiceMixin, forms.ModelMultip
         # string 'null'.  This will check for that condition and gracefully handle the conversion to a NoneType.
         if self.null_option is not None and settings.FILTERS_NULL_CHOICE_VALUE in value:
             value = [v for v in value if v != settings.FILTERS_NULL_CHOICE_VALUE]
-            return [None, *value]
+            return [None, *super().clean(value)]
 
         return super().clean(value)