Project_Camper/vagus/users/forms.py

22 lines
550 B
Python
Raw Normal View History

2020-12-07 21:41:55 +01:00
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
2021-01-27 20:09:55 +01:00
from phonenumber_field.formfields import PhoneNumberField
2020-12-07 21:41:55 +01:00
from .models import Base_User
class CustomUserCreationForm(UserCreationForm):
2021-01-27 20:09:55 +01:00
phone = PhoneNumberField()
2020-12-07 21:41:55 +01:00
class Meta(UserCreationForm):
model = Base_User
2021-01-27 20:09:55 +01:00
fields =['email','password','phone']
2020-12-07 21:41:55 +01:00
class CustomUserChangeForm(UserChangeForm):
2021-01-27 20:09:55 +01:00
phone = PhoneNumberField()
2020-12-07 21:41:55 +01:00
class Meta:
model = Base_User
2021-01-27 20:09:55 +01:00
fields = ['email','password','phone']
2020-12-07 21:41:55 +01:00