Change IPAddressField to GenericIPAddressField

When using a PostgreSQL database and the client does not pass an IP address you get an inet error.  This is a known problem with PostgreSQL and the IPAddressField.

https://code.djangoproject.com/ticket/5622

It can be fixed by using a GenericIPAddressField instead.
This commit is contained in:
polvoblanco 2014-07-31 17:57:33 +01:00
parent a6a3e476ac
commit 81bebc4c32

View file

@ -6,7 +6,7 @@ class CommonAccess(models.Model):
max_length=255,
)
ip_address = models.IPAddressField(
ip_address = models.GenericIPAddressField(
verbose_name='IP Address',
null=True,
)