Make IP addresses unique

This commit is contained in:
2011-05-01 01:59:42 +01:00
parent 59fc72fc04
commit 3a534490ce
2 changed files with 190 additions and 1 deletions

View File

@@ -72,7 +72,7 @@ class SSOUserIPAddress(models.Model):
last_seen = models.DateTimeField(auto_now_add=True, blank=False, null=False,
verbose_name="First sighting date/time",
help_text="Shows the most recent time the user has been seen at this IP.")
ip_address = models.CharField("IP Address", max_length=200, blank=False)
ip_address = models.CharField("IP Address", max_length=200, blank=False, unique=True)
user = models.ForeignKey(User, blank=False, null=False, related_name='ip_addresses')
def __unicode__(self):