Check for fields that are of the wrong type. Fix bug in ip_interface() validator thanks to this unittest

This commit is contained in:
Pim van Pelt
2022-03-13 20:20:14 +00:00
parent 0f03d6cbaa
commit 2ca7cc3f11
3 changed files with 20 additions and 0 deletions

View File

@ -33,6 +33,8 @@ class IPInterfaceWithPrefixLength(Validator):
network = ipaddress.ip_interface(value)
except:
return False
if not isinstance(value, str):
return False
if not '/' in value:
return False
e = value.split('/')