mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-19 09:53:34 -06:00
Fixes #10387: Fix MultiValueDictKeyError exception when editing a device interface
This commit is contained in:
parent
1d033bd286
commit
59388d89a0
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## v3.3.4 (FUTURE)
|
## v3.3.4 (FUTURE)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* [#10387](https://github.com/netbox-community/netbox/issues/10387) - Fix `MultiValueDictKeyError` exception when editing a device interface
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## v3.3.3 (2022-09-15)
|
## v3.3.3 (2022-09-15)
|
||||||
|
@ -1429,16 +1429,6 @@ class InterfaceForm(InterfaceCommonForm, ModularDeviceComponentForm):
|
|||||||
'rf_channel_width': "Populated by selected channel (if set)",
|
'rf_channel_width': "Populated by selected channel (if set)",
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
super().__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
# Restrict LAG/bridge interface assignment by device/VC
|
|
||||||
device_id = self.data['device'] if self.is_bound else self.initial.get('device')
|
|
||||||
device = Device.objects.filter(pk=device_id).first()
|
|
||||||
if device and device.virtual_chassis and device.virtual_chassis.master:
|
|
||||||
self.fields['lag'].widget.add_query_param('device_id', device.virtual_chassis.master.pk)
|
|
||||||
self.fields['bridge'].widget.add_query_param('device_id', device.virtual_chassis.master.pk)
|
|
||||||
|
|
||||||
|
|
||||||
class FrontPortForm(ModularDeviceComponentForm):
|
class FrontPortForm(ModularDeviceComponentForm):
|
||||||
rear_port = DynamicModelChoiceField(
|
rear_port = DynamicModelChoiceField(
|
||||||
|
Loading…
Reference in New Issue
Block a user