From e2213f458f02da9b4c9ad74e02672d761f5d78cf Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 1 Feb 2018 16:11:04 -0500 Subject: [PATCH] Allow assignment of services to IPs on any VC member --- netbox/ipam/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox/ipam/forms.py b/netbox/ipam/forms.py index c67921e3e..0865cfa55 100644 --- a/netbox/ipam/forms.py +++ b/netbox/ipam/forms.py @@ -939,8 +939,9 @@ class ServiceForm(BootstrapMixin, forms.ModelForm): # Limit IP address choices to those assigned to interfaces of the parent device/VM if self.instance.device: + vc_interface_ids = [i['id'] for i in self.instance.device.vc_interfaces.values('id')] self.fields['ipaddresses'].queryset = IPAddress.objects.filter( - interface__device=self.instance.device + interface_id__in=vc_interface_ids ) elif self.instance.virtual_machine: self.fields['ipaddresses'].queryset = IPAddress.objects.filter(