mirror of
https://framagit.org/la-chariotte/la-chariotte.git
synced 2025-05-02 11:52:27 +02:00
23 lines
665 B
Python
23 lines
665 B
Python
from django import forms
|
|
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
|
|
|
from .models import CustomUser
|
|
|
|
|
|
class CustomUserCreationForm(UserCreationForm):
|
|
class Meta:
|
|
model = CustomUser
|
|
fields = ("username", "first_name", "last_name", "password1", "password2")
|
|
widgets = {
|
|
"username": forms.TextInput(
|
|
attrs={
|
|
"placeholder": "exemple@mail.fr",
|
|
}
|
|
),
|
|
}
|
|
|
|
|
|
class CustomUserChangeForm(UserChangeForm): # pas encore utilisé - pour la V1
|
|
class Meta:
|
|
model = CustomUser
|
|
fields = ("email", "first_name", "last_name")
|