python-social-auth partial pipeline can not resume
I am trying to collect the password for the new user with partial pipeline of python-social-auth. For some unknown reason, I am not able to resume the pipeline, the page render back to the password collection page after I submit the form.
What's wired is that even I typed the http.../complete/backend-name, the page will redirect back to the password collection page. It looks like the rendering goes into an endless loop, the password collection page first point to the complete page, the complete page direct back to the password collection page. I checked the value for REDIRECT_FIELD_NAME, it is "next".
I am not sure what's wrong with my code, any tips/suggestions are greatly appreciated.
settings.py
SOCIAL_AUTH_PIPELINE = ( ... 'accounts.pipeline.get_password', ... )
pipeline.py
from django.shortcuts import redirect from social.pipeline.partial import partial @partial def get_password(strategy, details, user=None, is_new=False, *args, **kwargs): if is_new: return redirect('accounts_signup_social') else: return
views.py
def get_password(request): if request.method == 'POST': request.session['password'] = request.POST.get('password') backend = request.session['partial_pipeline']['backend'] return redirect('social:complete', backend=backend) return render_to_response('accounts/social_signup.html',{"form":SocialSignUpForm}, RequestContext(request))
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5365bbfc-6c85-4eff-9ebc-4b8694e9d10a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home