[Python-modules-commits] [python-social-auth] 40/89: Update twitter.py

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:15:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.15
in repository python-social-auth.

commit 96fc4d1e2bb63fc0a18e9f3416655d81b119d20b
Author: hellvix <elvisafc at gmail.com>
Date:   Tue Feb 23 14:24:07 2016 -0300

    Update twitter.py
    
    Applications submitted to Twitter's privileged list can now obtain user e-mail address.
---
 social/backends/twitter.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/social/backends/twitter.py b/social/backends/twitter.py
index c41f15a..9058bcf 100644
--- a/social/backends/twitter.py
+++ b/social/backends/twitter.py
@@ -27,7 +27,7 @@ class TwitterOAuth(BaseOAuth1):
         """Return user details from Twitter account"""
         fullname, first_name, last_name = self.get_user_names(response['name'])
         return {'username': response['screen_name'],
-                'email': '',  # not supplied
+                'email': response.get('email'),
                 'fullname': fullname,
                 'first_name': first_name,
                 'last_name': last_name}
@@ -35,6 +35,6 @@ class TwitterOAuth(BaseOAuth1):
     def user_data(self, access_token, *args, **kwargs):
         """Return user data provided"""
         return self.get_json(
-            'https://api.twitter.com/1.1/account/verify_credentials.json',
+            'https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true',
             auth=self.oauth_auth(access_token)
         )

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