mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-08-05 14:49:27 +02:00
Login is possible
This commit is contained in:
39
apps/member/forms.py
Normal file
39
apps/member/forms.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from django.contrib.auth.forms import UserCreationForm
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from member.models import TFJMUser
|
||||
|
||||
|
||||
class SignUpForm(UserCreationForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["first_name"].required = True
|
||||
self.fields["last_name"].required = True
|
||||
print(self.fields["role"].choices)
|
||||
self.fields["role"].choices = [
|
||||
('', _("Choose a role...")),
|
||||
('participant', _("Participant")),
|
||||
('encadrant', _("Encadrant")),
|
||||
]
|
||||
|
||||
class Meta:
|
||||
model = TFJMUser
|
||||
fields = (
|
||||
'role',
|
||||
'email',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'birth_date',
|
||||
'gender',
|
||||
'address',
|
||||
'postal_code',
|
||||
'city',
|
||||
'country',
|
||||
'phone_number',
|
||||
'school',
|
||||
'student_class',
|
||||
'responsible_name',
|
||||
'responsible_phone',
|
||||
'responsible_email',
|
||||
'description',
|
||||
)
|
Reference in New Issue
Block a user