Commit cfee3a09efdf998f040c5c38bff92ab6b7caeff3
Committed by
Sergio Oliveira
1 parent
51f56dd0
Exists in
master
and in
39 other branches
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,6 +32,11 @@ class UserForm(forms.ModelForm): | ||
32 | # Forces username to be lowercase always | 32 | # Forces username to be lowercase always |
33 | widget=forms.TextInput(attrs={'style' : 'text-transform: lowercase;'}), | 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 | required = ('first_name', 'last_name', 'email', 'username') | 40 | required = ('first_name', 'last_name', 'email', 'username') |
36 | 41 | ||
37 | class Meta: | 42 | class Meta: |
@@ -48,6 +53,7 @@ class UserForm(forms.ModelForm): | @@ -48,6 +53,7 @@ class UserForm(forms.ModelForm): | ||
48 | field.required = True | 53 | field.required = True |
49 | 54 | ||
50 | 55 | ||
56 | + | ||
51 | class UserCreationForm(UserForm): | 57 | class UserCreationForm(UserForm): |
52 | class Meta: | 58 | class Meta: |
53 | model = User | 59 | model = User |