summaryrefslogtreecommitdiff
path: root/packages/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-04-27 09:07:26 -0500
committerDan McGee <dan@archlinux.org>2012-04-27 09:12:26 -0500
commit4e1e28729f97eb694cdcae2f3fe51b5178963069 (patch)
tree9da48058e5538ef72d3472a43a92b3f35b77502f /packages/models.py
parent57c1176d9e918c9d11ecd4a1e8bea3f138c8cf6a (diff)
Use GenericIPAddressField in flag request ip_address
New (and slightly odd with regards to verbose_name) in Django 1.4. This simply ensures a deployment in an IPv6 environment actually works as expected. If you were using PostgreSQL as a database backend, you won't be affected by this as the 'inet' type was already used, but at least now you can edit the values in the admin without getting an error. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/models.py')
-rw-r--r--packages/models.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/models.py b/packages/models.py
index 820e61ba..7a7a81cd 100644
--- a/packages/models.py
+++ b/packages/models.py
@@ -173,7 +173,9 @@ class FlagRequest(models.Model):
user = models.ForeignKey(User, blank=True, null=True)
user_email = models.EmailField('email address')
created = models.DateTimeField(editable=False)
- ip_address = models.IPAddressField('IP address')
+ # Great work, Django... https://code.djangoproject.com/ticket/18212
+ ip_address = models.GenericIPAddressField(verbose_name='IP address',
+ unpack_ipv4=True)
pkgbase = models.CharField(max_length=255, db_index=True)
version = models.CharField(max_length=255, default='')
repo = models.ForeignKey(Repo)