Browse Source

Closes #6190: Allow filtering devices with no location assigned

jeremystretch 4 years ago
parent
commit
497e50c559
2 changed files with 4 additions and 2 deletions
  1. 1 0
      docs/release-notes/version-2.11.md
  2. 3 2
      netbox/dcim/forms.py

+ 1 - 0
docs/release-notes/version-2.11.md

@@ -5,6 +5,7 @@
 ### Enhancements
 
 * [#6189](https://github.com/netbox-community/netbox/issues/6189) - Add ability to search for locations by name or description
+* [#6190](https://github.com/netbox-community/netbox/issues/6190) - Allow filtering devices with no location assigned
 
 ### Bug Fixes
 

+ 3 - 2
netbox/dcim/forms.py

@@ -2429,10 +2429,11 @@ class DeviceFilterForm(BootstrapMixin, LocalConfigContextFilterForm, TenancyFilt
     location_id = DynamicModelMultipleChoiceField(
         queryset=Location.objects.all(),
         required=False,
-        label=_('Location'),
+        null_option='None',
         query_params={
             'site_id': '$site_id'
-        }
+        },
+        label=_('Location')
     )
     rack_id = DynamicModelMultipleChoiceField(
         queryset=Rack.objects.all(),