Commit 9ddd0e5e86478c0c0f9691da06be666c132ce229

Authored by Carlos Coêlho
Committed by Sergio Oliveira
1 parent 628107d9

Made email field for register form mandatory

If browserid is disabled, email field is added to form in order to
register user, but it was not required.

Signed-off-by: Carlos Oliveira <carlospecter@gmail.com>
Signed-off-by: Alexandre Almeida <alexandreab@live.com>
Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
colab/accounts/forms.py
... ... @@ -66,6 +66,7 @@ class UserCreationFormNoBrowserId(UserCreationForm):
66 66  
67 67 password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
68 68 password2 = forms.CharField(label=_("Confirm Password "), widget=forms.PasswordInput)
  69 + email = forms.EmailField(label=_("Email address"), required=True)
69 70  
70 71 class Meta:
71 72 model = User
... ... @@ -77,7 +78,7 @@ class UserCreationFormNoBrowserId(UserCreationForm):
77 78  
78 79 if password1 and password2 and password1 != password2:
79 80 raise forms.ValidationError(_("The two password fields didn't match."))
80   - return password2
  81 + return password2
81 82  
82 83 def save(self, commit=True):
83 84 """
... ...