[Python-modules-commits] [python-social-auth] 253/322: Append trailing slash in Django

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:13:16 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 9f459869c74e8f3ef91c81291203417a6ea5618b
Author: Christian Pedersen <chripede at gmail.com>
Date:   Wed Apr 15 13:18:30 2015 +0200

    Append trailing slash in Django
    
    This commit https://github.com/omab/python-social-auth/commit/f57e0caf4ec06f3b9a2367d9ff3897e2a3a71608 made trailing slashes optional.
    The side effect of that is that the redirect_uri is created without a trailing slash.
    With this change the standard Django APPEND_SLASH is checked when generating the redirect url.
---
 social/apps/django_app/utils.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/social/apps/django_app/utils.py b/social/apps/django_app/utils.py
index ff950a9..ae20098 100644
--- a/social/apps/django_app/utils.py
+++ b/social/apps/django_app/utils.py
@@ -37,6 +37,8 @@ def psa(redirect_uri=None, load_strategy=load_strategy):
             uri = redirect_uri
             if uri and not uri.startswith('/'):
                 uri = reverse(redirect_uri, args=(backend,))
+                if settings.APPEND_SLASH and not uri.endswith('/'):
+                    uri = uri + '/'
 
             request.social_strategy = load_strategy(request)
             # backward compatibility in attribute name, only if not already

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