From f7bb4009404a44ecce177e77d66c64068d813bea Mon Sep 17 00:00:00 2001 From: Joseph Kennedy Date: Tue, 22 Aug 2017 20:08:41 -0400 Subject: [PATCH] Try to fix lag field in InterfaceCSVForm...likely to fail --- netbox/dcim/forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index 7c6830b81..08ecb5d47 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -1541,9 +1541,11 @@ class InterfaceCSVForm(forms.ModelForm): name = forms.CharField( help_text='Name of interface' ) - lag = forms.CharField( + lag = FlexibleModelChoiceField( required=False, - help_text='Lag Name' + queryset = Interface.objects.order_naturally().filter(form_factor=IFACE_FF_LAG) + help_text='Lag Name', + error_messages={'invalid_choice': 'Lag not found.'} ) mac_address = forms.CharField( required=False,