use self.device

This commit is contained in:
Joseph Kennedy 2017-08-26 00:00:05 -04:00
parent da2f1560f4
commit 17428e7057

View File

@ -1597,10 +1597,10 @@ class InterfaceCSVForm(forms.ModelForm):
def clean_lag(self):
if device is not None:
interface_ordering = device.device_type.interface_ordering
if self.device is not None:
interface_ordering = self.device.device_type.interface_ordering
lag = Interface.objects.order_naturally(method=interface_ordering).filter(
device=device, form_factor=IFACE_FF_LAG).get(
device=self.device, form_factor=IFACE_FF_LAG).get(
lag=self.cleaned_data['lag'], name=lag
)