[Python-modules-commits] [python-social-auth] 91/322: updated mendeley oauth2 to use new api resource and also updated to grab new profile_id, name and bio
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 efa68bc0a059c8da2a2fa5e5e66ae5908a9533af
Author: Chris DeBlois <chris.deblois at globant.com>
Date: Mon Feb 2 23:52:52 2015 +0000
updated mendeley oauth2 to use new api resource and also updated to grab new profile_id, name and bio
---
social/backends/mendeley.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/social/backends/mendeley.py b/social/backends/mendeley.py
index 48464e7..fde57a5 100644
--- a/social/backends/mendeley.py
+++ b/social/backends/mendeley.py
@@ -12,13 +12,13 @@ class MendeleyMixin(object):
('bio', 'bio')]
def get_user_id(self, details, response):
- return response['main']['profile_id']
+ return response['id']
def get_user_details(self, response):
"""Return user details from Mendeley account"""
- profile_id = response['main']['profile_id']
- name = response['main']['name']
- bio = response['main']['bio']
+ profile_id = response['id']
+ name = response['display_name']
+ bio = response['link']
return {'profile_id': profile_id,
'name': name,
'bio': bio}
@@ -26,7 +26,7 @@ class MendeleyMixin(object):
def user_data(self, access_token, *args, **kwargs):
"""Return user data provided"""
values = self.get_user_data(access_token)
- values.update(values['main'])
+ values.update(values)
return values
def get_user_data(self, access_token):
@@ -62,6 +62,6 @@ class MendeleyOAuth2(MendeleyMixin, BaseOAuth2):
def get_user_data(self, access_token, *args, **kwargs):
"""Loads user data from service"""
return self.get_json(
- 'https://api-oauth2.mendeley.com/oapi/profiles/info/me/',
+ 'https://api.mendeley.com/profiles/me/',
headers={'Authorization': 'Bearer {0}'.format(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