[Python-modules-commits] [python-social-auth] 116/131: Simplify new_association check

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:17:10 UTC 2016


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

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

commit e0ee2607a7446be919cd27396441c490f4eca608
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Sat Aug 6 05:32:22 2016 -0300

    Simplify new_association check
---
 social/pipeline/social_auth.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/social/pipeline/social_auth.py b/social/pipeline/social_auth.py
index ff99404..b181ba5 100644
--- a/social/pipeline/social_auth.py
+++ b/social/pipeline/social_auth.py
@@ -17,7 +17,6 @@ def auth_allowed(backend, details, response, *args, **kwargs):
 
 def social_user(backend, uid, user=None, *args, **kwargs):
     provider = backend.name
-    new_association = True
     social = backend.strategy.storage.user.get_social_auth(provider, uid)
     if social:
         if user and social.user != user:
@@ -25,11 +24,10 @@ def social_user(backend, uid, user=None, *args, **kwargs):
             raise AuthAlreadyAssociated(backend, msg)
         elif not user:
             user = social.user
-        new_association = False
     return {'social': social,
             'user': user,
             'is_new': user is None,
-            'new_association': new_association}
+            'new_association': social is None}
 
 
 def associate_user(backend, uid, user=None, social=None, *args, **kwargs):

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