From cfbf5b65d872b940432d6990f3959cdf6765ba0b Mon Sep 17 00:00:00 2001 From: knobix <43905002+knobix@users.noreply.github.com> Date: Mon, 5 Nov 2018 21:33:10 +0100 Subject: [PATCH] Update models.py (#2502) Fix the handling of shared IPs (VIP, VRRF, etc.) when unique IP space enforcement is set. Add parentheses for the logical OR-statement to make the evaluation valid. Fixes: #2501 --- netbox/ipam/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/ipam/models.py b/netbox/ipam/models.py index f9170cd58..ef3bc6c30 100644 --- a/netbox/ipam/models.py +++ b/netbox/ipam/models.py @@ -596,11 +596,11 @@ class IPAddress(ChangeLoggedModel, CustomFieldModel): if self.address: # Enforce unique IP space (if applicable) - if self.role not in IPADDRESS_ROLES_NONUNIQUE and ( + if self.role not in IPADDRESS_ROLES_NONUNIQUE and (( self.vrf is None and settings.ENFORCE_GLOBAL_UNIQUE ) or ( self.vrf and self.vrf.enforce_unique - ): + )): duplicate_ips = self.get_duplicates() if duplicate_ips: raise ValidationError({