diff --git a/gestioncof/forms.py b/gestioncof/forms.py index 064eef8e..07b7cd89 100644 --- a/gestioncof/forms.py +++ b/gestioncof/forms.py @@ -200,9 +200,11 @@ class UserProfileForm(forms.ModelForm): class RegistrationUserForm(forms.ModelForm): def __init__(self, *args, **kw): + new_user = kw.get('instance') is None super(RegistrationUserForm, self).__init__(*args, **kw) self.fields['username'].help_text = "" - self.fields['username'].validators = [MinLengthValidator(9)] + if new_user: + self.fields['username'].validators = [MinLengthValidator(9)] class Meta: model = User