diff --git a/gestioncof/forms.py b/gestioncof/forms.py index 3916da8d..064eef8e 100644 --- a/gestioncof/forms.py +++ b/gestioncof/forms.py @@ -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