Closes #14141: translation cleanup (#14143)

* Translations cleanup

* Tweak variable names; misc string cleanup

* Misc cleanup
This commit is contained in:
Jeremy Stretch
2023-10-30 13:38:03 -04:00
committed by GitHub
parent bbf9018b37
commit 6652555b3c
19 changed files with 12408 additions and 69 deletions

View File

@@ -372,14 +372,14 @@ class IPAddressForm(TenancyForm, NetBoxModelForm):
# Do not allow assigning a network ID or broadcast address to an interface.
if interface and (address := self.cleaned_data.get('address')):
if address.ip == address.network:
msg = _("{address} is a network ID, which may not be assigned to an interface.").format(address=address)
msg = _("{ip} is a network ID, which may not be assigned to an interface.").format(ip=address.ip)
if address.version == 4 and address.prefixlen not in (31, 32):
raise ValidationError(msg)
if address.version == 6 and address.prefixlen not in (127, 128):
raise ValidationError(msg)
if address.version == 4 and address.ip == address.broadcast and address.prefixlen not in (31, 32):
msg = _("{address} is a broadcast address, which may not be assigned to an interface.").format(
address=address
msg = _("{ip} is a broadcast address, which may not be assigned to an interface.").format(
ip=address.ip
)
raise ValidationError(msg)