diff options
author | Dan McGee <dan@archlinux.org> | 2014-08-23 21:30:25 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2014-09-01 18:26:05 -0500 |
commit | 9d0db65025c229941d40e1d4f02f092c9d205723 (patch) | |
tree | 1d07b2a2360012ec64a2b22eee15ee5e5aee61b2 | |
parent | 28d486870de2c68b53e544a7082c991983d0d763 (diff) |
Fix up some IP address field issues
Ensure we always coerce values to unicode in our __unicode__ method, and
remove some now unneeded verbosity and comments since the upstream bug
has been fixed.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | mirrors/models.py | 4 | ||||
-rw-r--r-- | packages/models.py | 4 | ||||
-rw-r--r-- | releng/models.py | 4 |
3 files changed, 4 insertions, 8 deletions
diff --git a/mirrors/models.py b/mirrors/models.py index e360801b..641a6b97 100644 --- a/mirrors/models.py +++ b/mirrors/models.py @@ -118,7 +118,7 @@ class MirrorRsync(models.Model): created = models.DateTimeField(editable=False) def __unicode__(self): - return self.ip + return unicode(self.ip) class Meta: verbose_name = 'mirror rsync IP' @@ -127,7 +127,7 @@ class MirrorRsync(models.Model): class CheckLocation(models.Model): hostname = models.CharField(max_length=255) - source_ip = models.GenericIPAddressField(verbose_name='source IP', + source_ip = models.GenericIPAddressField('source IP', unpack_ipv4=True, unique=True) country = CountryField() created = models.DateTimeField(editable=False) diff --git a/packages/models.py b/packages/models.py index da8adc56..dd69e7d3 100644 --- a/packages/models.py +++ b/packages/models.py @@ -181,9 +181,7 @@ class FlagRequest(models.Model): user = models.ForeignKey(User, blank=True, null=True) user_email = models.EmailField('email address') created = models.DateTimeField(editable=False, db_index=True) - # Great work, Django... https://code.djangoproject.com/ticket/18212 - ip_address = models.GenericIPAddressField(verbose_name='IP address', - unpack_ipv4=True) + ip_address = models.GenericIPAddressField('IP address', unpack_ipv4=True) pkgbase = models.CharField(max_length=255, db_index=True) pkgver = models.CharField(max_length=255) pkgrel = models.CharField(max_length=255) diff --git a/releng/models.py b/releng/models.py index 5d4caf2b..c3ffd322 100644 --- a/releng/models.py +++ b/releng/models.py @@ -90,9 +90,7 @@ class Bootloader(IsoOption): class Test(models.Model): user_name = models.CharField(max_length=500) user_email = models.EmailField('email address') - # Great work, Django... https://code.djangoproject.com/ticket/18212 - ip_address = models.GenericIPAddressField(verbose_name='IP address', - unpack_ipv4=True) + ip_address = models.GenericIPAddressField('IP address', unpack_ipv4=True) created = models.DateTimeField(editable=False) iso = models.ForeignKey(Iso) |