[Python-modules-commits] [python-social-auth] 267/322: PEP8 and switch check order

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:13:18 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 4b4b9b9ebc0f3a3b3c45d156b21d86b6f7a15d57
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Thu Apr 16 20:43:29 2015 -0300

    PEP8 and switch check order
---
 social/pipeline/user.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/social/pipeline/user.py b/social/pipeline/user.py
index 0fac0ac..f4fcd64 100644
--- a/social/pipeline/user.py
+++ b/social/pipeline/user.py
@@ -46,7 +46,8 @@ def get_username(strategy, details, user=None, *args, **kwargs):
         # as base but adding a unique hash at the end. Original
         # username is cut to avoid any field max_length.
         # The final_username may be empty and will skip the loop.
-        while storage.user.user_exists(username=final_username) or not final_username:
+        while not final_username or \
+              storage.user.user_exists(username=final_username):
             username = short_username + uuid4().hex[:uuid_length]
             final_username = slug_func(clean_func(username[:max_length]))
     else:
@@ -59,8 +60,8 @@ def create_user(strategy, details, user=None, *args, **kwargs):
         return {'is_new': False}
 
     fields = dict((name, kwargs.get(name) or details.get(name))
-                        for name in strategy.setting('USER_FIELDS',
-                                                      USER_FIELDS))
+                  for name in strategy.setting('USER_FIELDS',
+                                               USER_FIELDS))
     if not fields:
         return
 
@@ -75,7 +76,7 @@ def user_details(strategy, details, user=None, *args, **kwargs):
     if user:
         changed = False  # flag to track changes
         protected = ('username', 'id', 'pk', 'email') + \
-                    tuple(strategy.setting('PROTECTED_USER_FIELDS', []))
+            tuple(strategy.setting('PROTECTED_USER_FIELDS', []))
 
         # Update user model attributes with the new data sent by the current
         # provider. Update on some attributes is disabled by default, for

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