Pankaj -

The fact that you're using a save() method here means that you're
using instructions referring to an older version of django-
registration. But you're probably actually deploying a current
version, which doesn't allow for that. The upgrade guide says:

"Previously, the form used to collect data during registration was
expected to implement a save() method which would create the new user
account. This is no longer the case; creating the account is handled
by the backend, and so any custom logic should be moved into a custom
backend, or by connecting listeners to the signals sent during the
registration process."

Details:

http://stackoverflow.com/questions/2601487/django-registration-django-profile-using-your-own-custom-form/2687377#2687377

Scot


On May 31, 1:07 am, Pankaj Singh <singh.pankaj.iitkg...@gmail.com>
wrote:
> I am using django-profiles with django-registration as per tutorial from
>
> http://praveensunsetpoint.wordpress.com/2009/04/21/django-registratio...
>
> But after the submitting the form I am getting this error
>
> AttributeError at /accounts/register/
>
> 'RegistrationForm' object has no attribute 'save'
>
> Please help me
>
> ########################################################################### 
> ######
>
> def register(request,
> success_url=None,form_class=RegistrationFormUniqueEmail,
> profile_callback=None,
>     template_name='registration/registration_form.html',
>     extra_context=None):
>     pform_class = utils.get_profile_form()
>
>     if request.method == 'POST':
>         profileform = pform_class(data=request.POST, files=request.FILES)
>         form = form_class(data=request.POST, files=request.FILES)
>
>         if form.is_valid():
>             new_user = form.save()
>             profile_obj = profileform.save(commit=False)
>             profile_obj.user = new_user
>             profile_obj.save()
>
>             return HttpResponseRedirect('/accounts/register/complete/')
>
>     else:
>         form = form_class()
>         profileform = pform_class()
>
>     if extra_context is None:
>         extra_context = {}
>         context = RequestContext(request)
>
>         for key, value in extra_context.items():
>             context[key] = callable(value) and value() or value
>
>     return render_to_response(template_name,{'form':
> form,'profileform':profileform,}, context_instance=context)
>
> ########################################################################### 
> #########

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to