
from allauth.account.forms import SignupForm
from django import forms
 
 
class CustomSignupForm(SignupForm):
    """ Custom allauth sinup form """
    first_name = forms.CharField(max_length=30, label='First Name')
    last_name = forms.CharField(max_length=30, label='Last Name')

    class Meta:
        model = SignupForm()
        fields = ('email', 'first_name', 'last_name')
 
    def save(self, request):
        user = super(CustomSignupForm, self).save(request)
        user.first_name = self.cleaned_data['first_name']
        user.last_name = self.cleaned_data['last_name']
        user.save()
        return user
