Repository: nautobot/nautobot

Issue:
Bug: VM Interface vlan list in UI uses invalid option
<!--
    NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED.

    This form is only for reporting reproducible bugs. If you need assistance
    with Nautobot installation, or if you have a general question, please start a
    discussion instead: https://github.com/nautobot/nautobot/discussions

    Please describe the environment in which you are running Nautobot. Be sure
    that you are running an unmodified instance of the latest stable release
    before submitting a bug report, and that any plugins have been disabled.
-->
### Environment
* Nautobot version (Docker tag too if applicable): 2.1.0
* Python version: 3.10
* Database platform, version: postgres, 14.10
* Middleware(s):

<!--
    Describe in detail the exact steps that someone else can take to reproduce
    this bug using the current stable release of Nautobot. Begin with the
    creation of any necessary database objects and call out every operation
    being performed explicitly. If reporting a bug in the REST API, be sure to
    reconstruct the raw HTTP request(s) being made: Don't rely on a client
    library such as pynautobot.
-->
### Steps to Reproduce
1. Create a VLAN
2. Create a Cluster Type
3. Create a Cluster
4. Create a VM in the cluster
5. Create a interface on the vm
6. Selected Access, Tagged or Tagged (all)

<!-- What did you expect to happen? -->
### Expected Behavior
Show a list of vlans


<!-- What happened instead? -->
### Observed Behavior
Dropdown shows "The results could not be loaded"

Was able to replicate on [demo.nautobot.com](https://demo.nautobot.com)

It appears that this dropdown tries to use an API query attribute/option called `location_id` however this seems to generate an 400. 

Looking at the API browser with `GET /api/ipam/vlans/?q=&limit=50&offset=0&depth=0&location_id=<<GUID>>` or even `GET /api/ipam/vlans/?q=&limit=50&offset=0&depth=0&location_id=null` returns 

```
HTTP 400 Bad Request
API-Version: 2.1
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "location_id": [
        "Unknown filter field"
    ]
}
```


Discussion:
Thanks for the report! Looks like there are quite a few cases in `nautobot/virtualization/forms.py` that are using `location_id` as a filter parameter, which should generally be `location` instead.
Hi @glennmatthews, still very very new to the model, but is it just a matter of the references under query_params being changed from
```  
        query_params={
            "location_id": "null",
        },
``` 
to 
```  
        query_params={
            "location": "null",
        },
``` 
?

If so, I'll give it a crack and if it pass any local linting & tests, follow the contributing guide to submit a PR if it will help. If there's more to it, I'll keep out of the way :D
That should be the gist of it, yes. Thank you!

Resolving patch:
diff --git a/nautobot/virtualization/forms.py b/nautobot/virtualization/forms.py
--- a/nautobot/virtualization/forms.py
+++ b/nautobot/virtualization/forms.py
@@ -404,7 +404,7 @@ class VMInterfaceForm(NautobotModelForm, InterfaceCommonForm):
         required=False,
         label="Untagged VLAN",
         query_params={
-            "location_id": "null",
+            "location": "null",
         },
     )
     tagged_vlans = DynamicModelMultipleChoiceField(
@@ -412,7 +412,7 @@ class VMInterfaceForm(NautobotModelForm, InterfaceCommonForm):
         required=False,
         label="Tagged VLANs",
         query_params={
-            "location_id": "null",
+            "location": "null",
         },
     )
     ip_addresses = DynamicModelMultipleChoiceField(
@@ -502,14 +502,14 @@ class VMInterfaceCreateForm(BootstrapMixin, InterfaceCommonForm):
         queryset=VLAN.objects.all(),
         required=False,
         query_params={
-            "location_id": "null",
+            "location": "null",
         },
     )
     tagged_vlans = DynamicModelMultipleChoiceField(
         queryset=VLAN.objects.all(),
         required=False,
         query_params={
-            "location_id": "null",
+            "location": "null",
         },
     )
     status = DynamicModelChoiceField(
@@ -570,14 +570,14 @@ class VMInterfaceBulkEditForm(TagsBulkEditFormMixin, StatusModelBulkEditFormMixi
         queryset=VLAN.objects.all(),
         required=False,
         query_params={
-            "location_id": "null",
+            "location": "null",
         },
     )
     tagged_vlans = DynamicModelMultipleChoiceField(
         queryset=VLAN.objects.all(),
         required=False,
         query_params={
-            "location_id": "null",
+            "location": "null",
         },
     )
 


Test patch: