From fae151d1643ad9b1ebdc842e0783fc9a931ac2b5 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 17 Aug 2023 08:06:07 -0700 Subject: [PATCH] 11617 remove l2vpntermination fix --- netbox/ipam/forms/bulk_import.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/netbox/ipam/forms/bulk_import.py b/netbox/ipam/forms/bulk_import.py index 785390e2d..3bce26249 100644 --- a/netbox/ipam/forms/bulk_import.py +++ b/netbox/ipam/forms/bulk_import.py @@ -548,11 +548,9 @@ class L2VPNTerminationImportForm(NetBoxModelImportForm): if self.cleaned_data.get('device') and self.cleaned_data.get('virtual_machine'): raise ValidationError('Cannot import device and VM interface terminations simultaneously.') - if not self.instance and not (self.cleaned_data.get('interface') or self.cleaned_data.get('vlan')): + if not (self.cleaned_data.get('interface') or self.cleaned_data.get('vlan')): raise ValidationError('Each termination must specify either an interface or a VLAN.') if self.cleaned_data.get('interface') and self.cleaned_data.get('vlan'): raise ValidationError('Cannot assign both an interface and a VLAN.') - # if this is an update we might not have interface or vlan in the form data - if self.cleaned_data.get('interface') or self.cleaned_data.get('vlan'): - self.instance.assigned_object = self.cleaned_data.get('interface') or self.cleaned_data.get('vlan') + self.instance.assigned_object = self.cleaned_data.get('interface') or self.cleaned_data.get('vlan')