[Python-modules-commits] [python-social-auth] 262/322: Fix the final_username may be empty and will skip the loop.

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:13:17 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 c50aed197c3637be785e9fa47571bbe384d72fbe
Author: zz <zz.at.field at gmail.com>
Date:   Thu Apr 16 17:45:11 2015 +0800

    Fix the final_username may be empty and will skip the loop.
---
 social/pipeline/user.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/social/pipeline/user.py b/social/pipeline/user.py
index 7e173a8..0fac0ac 100644
--- a/social/pipeline/user.py
+++ b/social/pipeline/user.py
@@ -45,7 +45,8 @@ def get_username(strategy, details, user=None, *args, **kwargs):
         # Generate a unique username for current user using username
         # as base but adding a unique hash at the end. Original
         # username is cut to avoid any field max_length.
-        while storage.user.user_exists(username=final_username):
+        # The final_username may be empty and will skip the loop.
+        while storage.user.user_exists(username=final_username) or not final_username:
             username = short_username + uuid4().hex[:uuid_length]
             final_username = slug_func(clean_func(username[:max_length]))
     else:

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