From: Matías Aguirre Date: Sat, 16 Jul 2011 06:12:28 +0000 (+0800) Subject: Use details username only if it's non-blank. Closes gh-104 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bb6a1b5bc687f51886285cefb419ef1fbfcd689b;p=django-social-auth.git Use details username only if it's non-blank. Closes gh-104 --- diff --git a/social_auth/backends/__init__.py b/social_auth/backends/__init__.py index c59a03b..bb9868a 100644 --- a/social_auth/backends/__init__.py +++ b/social_auth/backends/__init__.py @@ -166,7 +166,7 @@ class SocialAuthBackend(ModelBackend): if FORCE_RANDOM_USERNAME: username = mk_uuid() - elif USERNAME in details: + elif details.get(USERNAME): username = details[USERNAME] elif DEFAULT_USERNAME: username = DEFAULT_USERNAME