From 27a931339674c80a94c46c22aed73f846be80def Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 12 Apr 2022 08:13:08 -0400 Subject: [PATCH] #9096: Correct getattr() call --- netbox/utilities/forms/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/utilities/forms/utils.py b/netbox/utilities/forms/utils.py index db10cf1e0..9a4b011e0 100644 --- a/netbox/utilities/forms/utils.py +++ b/netbox/utilities/forms/utils.py @@ -146,7 +146,7 @@ def get_selected_values(form, field_name): # If the field has a `null_option` attribute set and it is selected, # add it to the field's grouped choices. - if getattr(field, 'null_option') and None in filter_data: + if getattr(field, 'null_option', None) and None in filter_data: values.remove(None) values.insert(0, field.null_option)