diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index f6a793cf2..c59aabc6c 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -1597,6 +1597,7 @@ class InterfaceCSVForm(forms.ModelForm): def clean_lag(self): + device = None if self.device is not None: interface_ordering = self.device.device_type.interface_ordering lag = Interface.objects.order_naturally(method=interface_ordering).filter(