1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #20484 -- Added model validation for GenericIPAddressField

GenericIPAddressField must not allow blank for NOT NULL fields

Thanks Erik Romijn.
This commit is contained in:
Tim Graham
2013-05-28 15:11:41 -04:00
parent a2967d5204
commit ded95ccdce
5 changed files with 23 additions and 6 deletions

View File

@@ -95,7 +95,7 @@ class GenericIPAddressTestModel(models.Model):
blank=True, null=True)
class GenericIPAddrUnpackUniqueTest(models.Model):
generic_v4unpack_ip = models.GenericIPAddressField(blank=True, unique=True, unpack_ipv4=True)
generic_v4unpack_ip = models.GenericIPAddressField(null=True, blank=True, unique=True, unpack_ipv4=True)
# A model can't have multiple AutoFields