I use this code (in forms.py) for my custom registration form for allauth:
class RegistrationForm(UserCreationForm): birth_date = forms.DateField(widget=extras.SelectDateWidget(years=BIRTH_DATE_YEARS)) class Meta: model = get_user_model() fields = ('username', 'email', 'password1', 'password2', 'first_name', 'last_name', 'gender', 'birth_date', 'city', 'country')
Of course, I pointed out ACCOUNT_SIGNUP_FORM_CLASS in settings.py to point to this form, and it displays the fields that I put into it. However, it does not work on presentation, even if I set the signup method, it will never be called. I tried using save , but itβs the same anyway - an error occurs when one of my added fields is empty when creating a user and saving it to the database. So what is the right code for this?
source share