python – How am I supposed to add a field to a signup form in django-allauth? Docs vs Stackoverflow vs Blog posts

python – How am I supposed to add a field to a signup form in django-allauth? Docs vs Stackoverflow vs Blog posts

So if this is your code verbatim, the error is that youre not calling the save method, because the brackets are missing:

class CustomSignupForm(forms.Form):
    opt_in = forms.BooleanField(label=Add me to the email list, help_text=Dont worry. We wont spam you., initial=True, required=False)

    def signup(self, request, user):
        user.opt_in = self.cleaned_data[opt_in]
        user.save() # Note ()

And that should fix your problem

python – How am I supposed to add a field to a signup form in django-allauth? Docs vs Stackoverflow vs Blog posts

Leave a Reply

Your email address will not be published.