Przeglądaj źródła

#9096: Correct getattr() call

jeremystretch 4 lat temu
rodzic
commit
27a9313396
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      netbox/utilities/forms/utils.py

+ 1 - 1
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)