Commit 9d2ff00dc8e9e0d0c225d4aa618404e18b3a930f

Authored by Gustavo Bernardo
1 parent 866bf3fc

Fixed validation error message in core/forms.py [Issue:#398]

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
@@ -37,7 +37,7 @@ class RegisterUserForm(forms.ModelForm): @@ -37,7 +37,7 @@ class RegisterUserForm(forms.ModelForm):
37 def clean_cpf(self): 37 def clean_cpf(self):
38 cpf = self.cleaned_data['cpf'] 38 cpf = self.cleaned_data['cpf']
39 if User.objects.filter(cpf = cpf).exists(): 39 if User.objects.filter(cpf = cpf).exists():
40 - raise forms.ValidationError(_('There is already a registeres User with this CPF')) 40 + raise forms.ValidationError(_('There is already a registered User with this CPF'))
41 # if not self.validate_cpf(cpf): 41 # if not self.validate_cpf(cpf):
42 # raise forms.ValidationError(_('Please enter a valid CPF')) 42 # raise forms.ValidationError(_('Please enter a valid CPF'))
43 return cpf 43 return cpf
@@ -76,4 +76,4 @@ class RegisterUserForm(forms.ModelForm): @@ -76,4 +76,4 @@ class RegisterUserForm(forms.ModelForm):
76 model = User 76 model = User
77 # exclude = ['is_staff', 'is_active'] 77 # exclude = ['is_staff', 'is_active']
78 fields = ['username', 'name', 'email', 'city', 'state', 'gender', 'cpf', 'birth_date', 'phone', 'image', 'titration', 78 fields = ['username', 'name', 'email', 'city', 'state', 'gender', 'cpf', 'birth_date', 'phone', 'image', 'titration',
79 - 'year_titration', 'institution', 'curriculum',]  
80 \ No newline at end of file 79 \ No newline at end of file
  80 + 'year_titration', 'institution', 'curriculum',]