Question

I am trying to extend registration form to include additional field. I get the following error in django-registration.

ERROR: form_valid() takes exactly 2 arguments (3 given) File "/Library/Python/2.7/site-packages/registration/views.py", line 35, in post

Using django-registration 1.0

Code:

class ExtendedRegistrationForm(RegistrationForm):
    profile_type = forms.CharField(max_length=30)

...

class ExtendedRegistrationView(RegistrationView):
    form_class = ExtendedRegistrationForm
    success_url = '/thanks/'

    def form_valid(self, form):
        #do some processing
        return super(ExtendedRegistrationView, self).form_valid(form)  


url(r'^myreg/register/$', ExtendedRegistrationView.as_view(), name='registration_register'),
Was it helpful?

Solution

form_valid:

def form_valid(self, request, form)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top