mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 01:06:11 -06:00
linting
This commit is contained in:
parent
1ea00350d7
commit
89a78a64a2
@ -365,12 +365,12 @@ class IPAddressForm(TenancyForm, NetBoxModelForm):
|
||||
prefix_str = f"{self.instance.address.network}/{self.instance.address.prefixlen}"
|
||||
allow_assignment_error = True
|
||||
if self.instance.vrf is None:
|
||||
prefix_obj = Prefix.objects.get(prefix=prefix_str)
|
||||
prefix_obj = Prefix.objects.get(prefix=prefix_str)
|
||||
else:
|
||||
prefix_obj = Prefix.objects.get(prefix=prefix_str, vrf=self.vrf)
|
||||
prefix_obj = Prefix.objects.get(prefix=prefix_str, vrf=self.vrf)
|
||||
if prefix_obj and prefix_obj.is_pool:
|
||||
allow_assignment_error = False
|
||||
|
||||
|
||||
if allow_assignment_error:
|
||||
if address.ip == address.network:
|
||||
msg = f"{address} is a network ID, which may not be assigned to an interface unless the prefix is a pool."
|
||||
|
Loading…
Reference in New Issue
Block a user