Empêche les conflits username-clipper
Le formulaire de création d'utilisateur empêche de choisir un username de moins de 8 caractères. Fixes #57
This commit is contained in:
parent
fd6b2d68d3
commit
5d685a04d7
1 changed files with 2 additions and 0 deletions
|
@ -10,6 +10,7 @@ from django.contrib.auth.models import User
|
|||
from django.forms.widgets import RadioSelect, CheckboxSelectMultiple
|
||||
from django.forms.formsets import BaseFormSet, formset_factory
|
||||
from django.db.models import Max
|
||||
from django.core.validators import MinLengthValidator
|
||||
|
||||
from gestioncof.models import CofProfile, EventCommentValue, \
|
||||
CalendarSubscription
|
||||
|
@ -201,6 +202,7 @@ class RegistrationUserForm(forms.ModelForm):
|
|||
def __init__(self, *args, **kw):
|
||||
super(RegistrationUserForm, self).__init__(*args, **kw)
|
||||
self.fields['username'].help_text = ""
|
||||
self.fields['username'].validators = [MinLengthValidator(9)]
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
|
|
Loading…
Reference in a new issue