saving works now
This commit is contained in:
30
backend/accounts/forms.py
Normal file
30
backend/accounts/forms.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from django import forms
|
||||
from django.contrib.auth.forms import UserCreationForm
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class SignupForm(UserCreationForm):
|
||||
first_name = forms.CharField(
|
||||
label='Nome',
|
||||
max_length=30,
|
||||
required=False,
|
||||
widget=forms.TextInput(attrs={'autofocus': 'autofocus'})
|
||||
)
|
||||
last_name = forms.CharField(label='Sobrenome', max_length=30, required=False) # noqa E501
|
||||
username = forms.CharField(label='Usuário', max_length=150)
|
||||
email = forms.CharField(
|
||||
label='E-mail',
|
||||
max_length=254,
|
||||
help_text='Requerido. Informe um e-mail válido.',
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = (
|
||||
'first_name',
|
||||
'last_name',
|
||||
'username',
|
||||
'email',
|
||||
'password1',
|
||||
'password2'
|
||||
)
|
||||
Reference in New Issue
Block a user