1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #2455: Ignore unique address enforcement for IPs with a shared/virtual role

This commit is contained in:
Jeremy Stretch
2018-09-24 16:59:33 -04:00
parent 0e18997c79
commit 9440ac7640
4 changed files with 22 additions and 1 deletions

View File

@@ -596,7 +596,11 @@ class IPAddress(ChangeLoggedModel, CustomFieldModel):
if self.address:
# Enforce unique IP space (if applicable)
if (self.vrf is None and settings.ENFORCE_GLOBAL_UNIQUE) or (self.vrf and self.vrf.enforce_unique):
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({