From a58e90cc2fc066840e44ec61100d0b9496c1e502 Mon Sep 17 00:00:00 2001 From: chirac Date: Wed, 6 Jul 2016 12:02:49 +0200 Subject: [PATCH] =?UTF-8?q?32=20caract=C3=A8res=20pour=20le=20login,=20et?= =?UTF-8?q?=20minuscules=20pour=20le=20dns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- machines/models.py | 3 +++ users/models.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/machines/models.py b/machines/models.py index f8d243d4..b7aad3e1 100644 --- a/machines/models.py +++ b/machines/models.py @@ -56,6 +56,9 @@ class Interface(models.Model): def __str__(self): return self.dns + def clean(self): + self.dns=self.dns.lower() + class IpList(models.Model): ipv4 = models.GenericIPAddressField(protocol='IPv4', unique=True) diff --git a/users/models.py b/users/models.py index a6a29168..8e5af681 100644 --- a/users/models.py +++ b/users/models.py @@ -37,7 +37,7 @@ class User(models.Model): name = models.CharField(max_length=255) surname = models.CharField(max_length=255) - pseudo = models.CharField(max_length=255, unique=True, help_text="Doit contenir uniquement des lettres, chiffres, ou tirets", validators=[linux_user_validator]) + pseudo = models.CharField(max_length=32, unique=True, help_text="Doit contenir uniquement des lettres, chiffres, ou tirets", validators=[linux_user_validator]) email = models.EmailField() school = models.ForeignKey('School', on_delete=models.PROTECT, null=False, blank=False) comment = models.CharField(help_text="Commentaire, promo", max_length=255, blank=True)