Friday, January 10, 2014

Re: python-social-auth partial pipeline can not resume

Ok. I found the problem and the solution.

As the documentation said, "The pipeline will resume in the same function that cut the process." athttp://python-social-auth.readthedocs.org/en/latest/pipeline.html. Which means it will always render back to the same function.

The solution is to add the session check for the password in the pipeline. Return back to the next pipeline if the password is archived:

pipeline:

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:          if 'password' in kwargs['request'].session:              return {'password': kwargs['request'].session['psssword']}          else:              return redirect('accounts_signup_social')      else:          return

--
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/35c61dd5-bb6b-4b0b-a6e0-65632a54c768%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate