[Python-modules-commits] [python-social-auth] 92/322: Ensure email is not None
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:12:53 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 5721df64b4ffe23b68c54a7fe945caa9fa545aa7
Author: Ian Wienand <iwienand at redhat.com>
Date: Tue Feb 3 11:45:11 2015 +1100
Ensure email is not None
If a user chooses not to share their email via the OpenId login page,
we end up passing through None as the 'email' value, which ends up
raising a "column 'email' cannot be null" error on some databases.
Blank string is fine.
---
social/backends/open_id.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/social/backends/open_id.py b/social/backends/open_id.py
index 0fd28f5..11c2bfc 100644
--- a/social/backends/open_id.py
+++ b/social/backends/open_id.py
@@ -96,6 +96,7 @@ class OpenIdAuth(BaseAuth):
fullname = values.get('fullname') or ''
first_name = values.get('first_name') or ''
last_name = values.get('last_name') or ''
+ email = values.get('email') or ''
if not fullname and first_name and last_name:
fullname = first_name + ' ' + last_name
@@ -109,7 +110,8 @@ class OpenIdAuth(BaseAuth):
values.update({'fullname': fullname, 'first_name': first_name,
'last_name': last_name,
'username': values.get(username_key) or
- (first_name.title() + last_name.title())})
+ (first_name.title() + last_name.title()),
+ 'email': email})
return values
def extra_data(self, user, uid, response, details):
--
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