diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index 8af8df783..75c99f52b 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -1670,8 +1670,15 @@ class PlatformCSVForm(CSVModelForm): # class DeviceForm(BootstrapMixin, TenancyForm, CustomFieldModelForm): + region = DynamicModelChoiceField( + queryset=Region.objects.all(), + required=False + ) site = DynamicModelChoiceField( - queryset=Site.objects.all() + queryset=Site.objects.all(), + query_params={ + 'region_id': '$region' + } ) rack = DynamicModelChoiceField( queryset=Rack.objects.all(), diff --git a/netbox/templates/dcim/device_edit.html b/netbox/templates/dcim/device_edit.html index 1486c1ad5..0f1ac2886 100644 --- a/netbox/templates/dcim/device_edit.html +++ b/netbox/templates/dcim/device_edit.html @@ -21,6 +21,7 @@