Problem in adding custom fields to django-registration

Posted by Pankaj Singh on Stack Overflow See other posts from Stack Overflow or by Pankaj Singh
Published on 2010-05-29T11:45:42Z Indexed on 2010/05/29 11:52 UTC
Read the original article Hit count: 478

I tried extending RegistrationFormUniqueEmail

class CustomRegistrationFormUniqueEmail(RegistrationFormUniqueEmail):
    first_name = forms.CharField(label=_('First name'), max_length=30,required=True)
    last_name = forms.CharField(label=_('Last name'), max_length=30, required=True)
    def save(self, profile_callback=None):
        new_user = super(CustomRegistrationFormUniqueEmail, self).save(profile_callback=profile_callback)
        new_user.first_name = self.cleaned_data['first_name']
        new_user.last_name = self.cleaned_data['last_name']
        return new_user

then changing view

#       form = form_class(data=request.POST, files=request.FILES)
        form = CustomRegistrationFormUniqueEmail(data=request.POST, files=request.FILES)

but still I am seeing default view containg four fields only ..

help is needed

© Stack Overflow or respective owner

Related posts about python

Related posts about django