[Python-modules-commits] [python-social-auth] 56/131: PEP8
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:17:01 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 9d8073f419178d2ec61b98c79931570a4b8a9e49
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date: Sat Jun 4 22:10:33 2016 -0300
PEP8
---
docs/backends/untappd.rst | 3 ++-
social/backends/untappd.py | 26 ++++++++++++++++++--------
2 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/docs/backends/untappd.rst b/docs/backends/untappd.rst
index bb1157a..0b41a12 100644
--- a/docs/backends/untappd.rst
+++ b/docs/backends/untappd.rst
@@ -5,7 +5,8 @@ Untappd uses OAuth v2 for Authentication, check the `official docs`_.
- Create an app by filling out the form here: `Add App`_
-- Apps are approved on a one-by-one basis, so you'll need to wait a few days to get your client ID and secret.
+- Apps are approved on a one-by-one basis, so you'll need to wait a
+ few days to get your client ID and secret.
- Fill ``Client ID`` and ``Client Secret`` values in the settings::
diff --git a/social/backends/untappd.py b/social/backends/untappd.py
index 8d5b71d..7d241ad 100644
--- a/social/backends/untappd.py
+++ b/social/backends/untappd.py
@@ -36,7 +36,9 @@ class UntappdOAuth2(BaseOAuth2):
return params
def process_error(self, data):
- """ All errors from Untappd are contained in the 'meta' key of the response. """
+ """
+ All errors from Untappd are contained in the 'meta' key of the response.
+ """
response_code = data.get('meta', {}).get('http_code')
if response_code is not None and response_code != requests.codes.ok:
raise AuthFailed(self, data['meta']['error_detail'])
@@ -49,7 +51,8 @@ class UntappdOAuth2(BaseOAuth2):
self.process_error(self.data)
- # Untapped sends the access token request with URL parameters, not a body
+ # Untapped sends the access token request with URL parameters,
+ # not a body
response = self.request_access_token(
self.access_token_url(),
method=self.ACCESS_TOKEN_METHOD,
@@ -64,9 +67,13 @@ class UntappdOAuth2(BaseOAuth2):
self.process_error(response)
- # Both the access_token and the rest of the response are buried in the 'response' key
- return self.do_auth(response['response']['access_token'], response=response['response'],
- *args, **kwargs)
+ # Both the access_token and the rest of the response are
+ # buried in the 'response' key
+ return self.do_auth(
+ response['response']['access_token'],
+ response=response['response'],
+ *args, **kwargs
+ )
def get_user_details(self, response):
"""Return user details from an Untappd account"""
@@ -79,13 +86,16 @@ class UntappdOAuth2(BaseOAuth2):
'email': user_data.get('settings', {}).get('email_address', ''),
'first_name': user_data.get('first_name'),
'last_name': user_data.get('last_name'),
- 'fullname': user_data.get('first_name') + ' ' + user_data.get('last_name')
+ 'fullname': user_data.get('first_name') + ' ' +
+ user_data.get('last_name')
})
return user_data
def get_user_id(self, details, response):
- """Return a unique ID for the current user, by default from server
- response."""
+ """
+ Return a unique ID for the current user, by default from
+ server response.
+ """
return response['user'].get(self.ID_KEY)
def user_data(self, access_token, *args, **kwargs):
--
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