1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +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

@@ -601,6 +601,13 @@ Miscellaneous
``django.contrib.admindocs.middleware`` because it is an implementation
detail of admindocs, proven not to be reusable in general.
* :class:`~django.db.models.GenericIPAddressField` will now only allow
``blank`` values if ``null`` values are also allowed. Creating a
``GenericIPAddressField`` where ``blank`` is allowed but ``null`` is not
will trigger a model validation error because ``blank`` values are always
stored as ``null``. Previously, storing a ``blank`` value in a field which
did not allow ``null`` would cause a database exception at runtime.
Features deprecated in 1.6
==========================