[Python-modules-commits] [python-social-auth] 26/322: Pass request to pyramid strategy. Refs #390

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:12:45 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 198c1614735c5ee0b84b4636abc874f66ee62c17
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Sun Nov 2 00:06:01 2014 -0200

    Pass request to pyramid strategy. Refs #390
---
 social/apps/pyramid_app/utils.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/social/apps/pyramid_app/utils.py b/social/apps/pyramid_app/utils.py
index 832bc5b..d0c3add 100644
--- a/social/apps/pyramid_app/utils.py
+++ b/social/apps/pyramid_app/utils.py
@@ -21,8 +21,12 @@ def get_helper(name):
     return settings.get(setting_name(name), DEFAULTS.get(name, None))
 
 
-def load_strategy():
-    return get_strategy(get_helper('STRATEGY'), get_helper('STORAGE'))
+def load_strategy(request):
+    return get_strategy(
+        get_helper('STRATEGY'),
+        get_helper('STORAGE'),
+        request
+    )
 
 
 def load_backend(strategy, name, redirect_uri):
@@ -43,7 +47,7 @@ def psa(redirect_uri=None):
             if uri and not uri.startswith('/'):
                 uri = request.route_url(uri, backend=backend)
 
-            request.strategy = load_strategy()
+            request.strategy = load_strategy(request)
             request.backend = load_backend(request.strategy, backend, uri)
             return func(request, *args, **kwargs)
         return wrapper

-- 
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