25 lines
604 B
Python
25 lines
604 B
Python
|
from django import forms
|
||
|
from django.contrib.auth.models import User
|
||
|
from django.contrib.auth.forms import UserCreationForm
|
||
|
from .models import UserProfile
|
||
|
|
||
|
|
||
|
class UserRegistrationForm(UserCreationForm):
|
||
|
email = forms.EmailField()
|
||
|
|
||
|
class Meta:
|
||
|
model = User
|
||
|
fields = ['username', 'email', 'password1', 'password2']
|
||
|
|
||
|
|
||
|
class UserProfileForm(forms.ModelForm):
|
||
|
class Meta:
|
||
|
model = UserProfile
|
||
|
fields = ['timezone', 'language_code']
|
||
|
|
||
|
|
||
|
class UserProfileFormLanguageOnly(forms.ModelForm):
|
||
|
class Meta:
|
||
|
model = UserProfile
|
||
|
fields = ['language_code']
|