diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index 60571e555..3eb232026 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -18,6 +18,7 @@ * [#4067](https://github.com/netbox-community/netbox/issues/4067) - Correct permission checked when creating a rack (vs. editing) * [#4071](https://github.com/netbox-community/netbox/issues/4071) - Enforce "view tag" permission on individual tag view * [#4079](https://github.com/netbox-community/netbox/issues/4079) - Fix assignment of power panel when bulk editing power feeds +* [#4084](https://github.com/netbox-community/netbox/issues/4084) - Fix exception when creating an interface with tagged VLANs --- diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index 0320eefce..723491610 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -2606,7 +2606,6 @@ class InterfaceForm(InterfaceCommonForm, BootstrapMixin, forms.ModelForm): type=InterfaceTypeChoices.TYPE_LAG ) else: - device = self.instance.device self.fields['lag'].queryset = Interface.objects.filter( device__in=[self.instance.device, self.instance.device.get_vc_master()], type=InterfaceTypeChoices.TYPE_LAG @@ -2614,6 +2613,10 @@ class InterfaceForm(InterfaceCommonForm, BootstrapMixin, forms.ModelForm): class InterfaceCreateForm(InterfaceCommonForm, ComponentForm, forms.Form): + device = forms.ModelChoiceField( + queryset=Device.objects.all(), + widget=forms.HiddenInput() + ) name_pattern = ExpandableNameField( label='Name' ) diff --git a/netbox/templates/dcim/device_component_add.html b/netbox/templates/dcim/device_component_add.html index 91f39ab9b..db9bec8cc 100644 --- a/netbox/templates/dcim/device_component_add.html +++ b/netbox/templates/dcim/device_component_add.html @@ -6,6 +6,9 @@ {% block content %}