Explorar o código

Updated clean method on DynamicModelMultipleChoiceField to return the name.

Julio-Oliveira-Encora %!s(int64=2) %!d(string=hai) anos
pai
achega
6c51b89502
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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)