[Python-modules-commits] [python-social-auth] 167/322: PEP8, quotes and extra_data
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:13:04 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 6dcb3dd44b4bfa2559002a95295ab254e3c0f110
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date: Sat Mar 7 22:24:57 2015 -0200
PEP8, quotes and extra_data
---
social/backends/eveonline.py | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/social/backends/eveonline.py b/social/backends/eveonline.py
index c62439f..1a22ed6 100644
--- a/social/backends/eveonline.py
+++ b/social/backends/eveonline.py
@@ -2,9 +2,6 @@
EVE Online Single Sign-On (SSO) OAuth2 backend
Documentation at https://developers.eveonline.com/resource/single-sign-on
"""
-from requests import HTTPError
-
-from social.exceptions import AuthFailed
from social.backends.oauth import BaseOAuth2
@@ -13,27 +10,32 @@ class EVEOnlineOAuth2(BaseOAuth2):
name = 'eveonline'
AUTHORIZATION_URL = 'https://login.eveonline.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://login.eveonline.com/oauth/token'
- ID_KEY = "CharacterID"
+ ID_KEY = 'CharacterID'
ACCESS_TOKEN_METHOD = 'POST'
EXTRA_DATA = [
('CharacterID', 'id'),
+ ('ExpiresOn', 'expires'),
+ ('CharacterOwnerHash', 'owner_hash', True),
('refresh_token', 'refresh_token', True),
- ('expires_in', 'expires'),
]
def get_user_details(self, response):
"""Return user details from EVE Online account"""
user_data = self.user_data(response['access_token'])
- print user_data
- fullname, first_name, last_name = self.get_user_names(user_data['CharacterName'])
- return {'username': fullname,
- 'fullname': fullname,
- 'first_name': first_name,
- 'last_name': last_name}
+ fullname, first_name, last_name = self.get_user_names(
+ user_data['CharacterName']
+ )
+ return {
+ 'email': '',
+ 'username': fullname,
+ 'fullname': fullname,
+ 'first_name': first_name,
+ 'last_name': last_name
+ }
def user_data(self, access_token, *args, **kwargs):
"""Get Character data from EVE server"""
return self.get_json(
'https://login.eveonline.com/oauth/verify',
- headers={'Authorization': "Bearer {0}".format(access_token)}
+ 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