17 lines
564 B
Python
17 lines
564 B
Python
from django import forms
|
|
from django.contrib.auth.forms import UserCreationForm
|
|
from django.contrib.auth.models import User
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
class RegistrationForm(UserCreationForm):
|
|
email = forms.EmailField(
|
|
label=_("Email address"),
|
|
widget=forms.TextInput(),
|
|
required=True,
|
|
help_text=_("Please enter a valid email address ending with `@crans.org` or `@ens-paris-saclay.fr`."),
|
|
)
|
|
|
|
class Meta:
|
|
model = User
|
|
fields = ["username", "password1", "password2", "email"]
|