From 0f964addf9f97bdbfb55b8a9426a40d9e7357ee4 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Thu, 11 Feb 2021 16:18:48 -0600 Subject: [PATCH] Adjust check for FILTERS_NULL_CHOICE_VALUE --- netbox/utilities/forms/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/utilities/forms/fields.py b/netbox/utilities/forms/fields.py index 055fc62ab..bc670203c 100644 --- a/netbox/utilities/forms/fields.py +++ b/netbox/utilities/forms/fields.py @@ -361,7 +361,7 @@ class DynamicModelChoiceField(DynamicModelChoiceMixin, forms.ModelChoiceField): When null option is enabled and "None" is sent as part of a form to be submitted, it is sent as the string 'null'. This will check for that condition and gracefully handle the conversion to a NoneType. """ - if self.null_option is not None and value == 'null': + if self.null_option is not None and value == settings.FILTERS_NULL_CHOICE_VALUE: return None return super().clean(value)