Merge "netaddr: fix IP conversion issues with netaddr>1.0.0"
This commit is contained in:
commit
84a921d2e9
@ -89,7 +89,11 @@ class IPField(fields.Field):
|
||||
|
||||
try:
|
||||
if self.mask:
|
||||
self.ip = netaddr.IPNetwork(value)
|
||||
try:
|
||||
self.ip = netaddr.IPNetwork(value.strip())
|
||||
except netaddr.AddrFormatError:
|
||||
self.ip = netaddr.IPNetwork(
|
||||
netaddr.cidr_abbrev_to_verbose(value.strip()))
|
||||
else:
|
||||
self.ip = netaddr.IPAddress(value)
|
||||
except Exception:
|
||||
|
Loading…
Reference in New Issue
Block a user