[Python-modules-commits] [python-social-auth] 45/322: Allow the pipeline to change the redirect url. Moves the popping of the redirect value from the session to after the pipe line executes.

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:12:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.10
in repository python-social-auth.

commit df3ff37f606e667069940732e5437ade4b70002c
Author: tschilling <schillingt at better-simple.com>
Date:   Fri Nov 21 09:08:04 2014 -0500

    Allow the pipeline to change the redirect url.
    Moves the popping of the redirect value from the session to after the
    pipe line executes.
---
 social/actions.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/social/actions.py b/social/actions.py
index 0001f03..154c6e4 100644
--- a/social/actions.py
+++ b/social/actions.py
@@ -27,10 +27,7 @@ def do_auth(backend, redirect_name='next'):
 
 def do_complete(backend, login, user=None, redirect_name='next',
                 *args, **kwargs):
-    # pop redirect value before the session is trashed on login()
     data = backend.strategy.request_data()
-    redirect_value = backend.strategy.session_get(redirect_name, '') or \
-                     data.get(redirect_name, '')
 
     is_authenticated = user_is_authenticated(user)
     user = is_authenticated and user or None
@@ -42,6 +39,12 @@ def do_complete(backend, login, user=None, redirect_name='next',
     else:
         user = backend.complete(user=user, *args, **kwargs)
 
+
+    # pop redirect value before the session is trashed on login(), but after
+    # the pipeline so that the pipeline can change the redirect if needed
+    redirect_value = backend.strategy.session_get(redirect_name, '') or \
+                     data.get(redirect_name, '')
+
     user_model = backend.strategy.storage.user.user_model()
     if user and not isinstance(user, user_model):
         return user

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git



More information about the Python-modules-commits mailing list