[Python-modules-commits] [python-social-auth] 69/131: username max_length can be None

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:17:03 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 f1716dc0155a7b0f352acf54cf6ecf4a8642c8bf
Author: Edward Betts <edward at 4angle.com>
Date:   Wed Jul 13 12:00:21 2016 +0100

    username max_length can be None
    
    When using postgres it is possible to make the username field a varchar
    with no maximum size.
---
 social/pipeline/user.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/social/pipeline/user.py b/social/pipeline/user.py
index a46fc3e..e5f8d65 100644
--- a/social/pipeline/user.py
+++ b/social/pipeline/user.py
@@ -39,7 +39,9 @@ def get_username(strategy, details, user=None, *args, **kwargs):
         else:
             username = uuid4().hex
 
-        short_username = username[:max_length - uuid_length]
+        short_username = (username[:max_length - uuid_length]
+                          if max_length is not None
+                          else username)
         final_username = slug_func(clean_func(username[:max_length]))
 
         # Generate a unique username for current user using username

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