Commit cfee3a09efdf998f040c5c38bff92ab6b7caeff3

Authored by Carlos Coêlho
Committed by Sergio Oliveira
1 parent 51f56dd0

Set email to be read-only field

Email is a read-only field so that user won't change it in the
'Register' step

Signed-off-by: Carlos Oliveira <carlospecter@gmail.com>
Showing 1 changed file with 6 additions and 0 deletions   Show diff stats
colab/accounts/forms.py
... ... @@ -32,6 +32,11 @@ class UserForm(forms.ModelForm):
32 32 # Forces username to be lowercase always
33 33 widget=forms.TextInput(attrs={'style' : 'text-transform: lowercase;'}),
34 34 )
  35 + email = forms.EmailField(
  36 +
  37 + # Forces email to be a read-only field
  38 + widget=forms.TextInput(attrs={'readonly': 'readonly'})
  39 + )
35 40 required = ('first_name', 'last_name', 'email', 'username')
36 41  
37 42 class Meta:
... ... @@ -48,6 +53,7 @@ class UserForm(forms.ModelForm):
48 53 field.required = True
49 54  
50 55  
  56 +
51 57 class UserCreationForm(UserForm):
52 58 class Meta:
53 59 model = User
... ...