[Python-modules-commits] [python-social-auth] 111/131: Fix upwork test

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:17:09 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 e88774b11ad4816431bb3cd96bb9d9eb2cd196c0
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Sat Aug 6 05:24:15 2016 -0300

    Fix upwork test
---
 docs/backends/upwork.rst  | 2 +-
 social/backends/upwork.py | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/docs/backends/upwork.rst b/docs/backends/upwork.rst
index 8e5d2c8..59b5990 100644
--- a/docs/backends/upwork.rst
+++ b/docs/backends/upwork.rst
@@ -1,5 +1,5 @@
 Upwork
-=======
+======
 
 Upwork supports only OAuth 1.
 
diff --git a/social/backends/upwork.py b/social/backends/upwork.py
index f7dcdc2..64f4deb 100644
--- a/social/backends/upwork.py
+++ b/social/backends/upwork.py
@@ -17,11 +17,15 @@ class UpworkOAuth(BaseOAuth1):
 
     def get_user_details(self, response):
         """Return user details from Upwork account"""
+        info = response.get('info', {})
         auth_user = response.get('auth_user', {})
         first_name = auth_user.get('first_name')
         last_name = auth_user.get('last_name')
         fullname = '{} {}'.format(first_name, last_name)
+        profile_url = info.get('profile_url', '')
+        username = profile_url.rsplit('/')[-1].replace('~', '')
         return {
+            'username': username,
             'fullname': fullname,
             'first_name': first_name,
             'last_name': last_name

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