Rework account.forms.RegistrationForm
This commit is contained in:
parent
b9013c4eb3
commit
122794a49d
1 changed files with 8 additions and 4 deletions
|
|
@ -1,13 +1,17 @@
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.contrib.auth.forms import UserCreationForm
|
from django.contrib.auth.forms import UserCreationForm
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class RegistrationForm(UserCreationForm):
|
class RegistrationForm(UserCreationForm):
|
||||||
email = forms.EmailField(label="Email", widget=forms.TextInput(), required=True)
|
email = forms.EmailField(
|
||||||
first_name = forms.CharField(label="Prénom", widget=forms.TextInput(), required=True)
|
label=_("Email address"),
|
||||||
last_name = forms.CharField(label="Nom", widget=forms.TextInput(), required=True)
|
widget=forms.TextInput(),
|
||||||
|
required=True,
|
||||||
|
help_text=_("Please enter a valid email address ending with `@crans.org` or `@ens-paris-saclay.fr`."),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
fields = ["username", "password1", "password2", "email", "first_name", "last_name"]
|
fields = ["username", "password1", "password2", "email"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue