mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 10:58:37 -06:00
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
This commit is contained in:
parent
ad6500e4f2
commit
cfbf5b65d8
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user