[Python-modules-commits] [python-social-auth] 208/322: PEP8. Refs #570

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:13:10 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 05a4c08352b7c72a08a7df0c709e6172f4ce33c9
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Tue Mar 31 12:12:37 2015 -0300

    PEP8. Refs #570
---
 social/backends/nk.py | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/social/backends/nk.py b/social/backends/nk.py
index 0ad3813..1446ad1 100644
--- a/social/backends/nk.py
+++ b/social/backends/nk.py
@@ -1,9 +1,11 @@
-import json
-from urllib import urlencode, urlopen
+from urllib import urlencode
+
+import six
+
 from requests_oauthlib import OAuth1
 
 from social.backends.oauth import BaseOAuth2
-import six
+
 
 class NKOAuth2(BaseOAuth2):
     """NK OAuth authentication backend"""
@@ -20,10 +22,12 @@ class NKOAuth2(BaseOAuth2):
     def get_user_details(self, response):
         """Return user details from NK account"""
         entry = response['entry']
-        return {'username': entry.get('displayName'),
-                'email': entry['emails'][0]['value'],
-                'first_name': entry.get('displayName').split(" ")[0],
-                'id':entry.get('id')}
+        return {
+            'username': entry.get('displayName'),
+            'email': entry['emails'][0]['value'],
+            'first_name': entry.get('displayName').split(' ')[0],
+            'id': entry.get('id')
+        }
 
     def auth_complete_params(self, state=None):
         client_id, client_secret = self.get_key_and_secret()
@@ -33,7 +37,7 @@ class NKOAuth2(BaseOAuth2):
             'client_id': client_id,
             'client_secret': client_secret,
             'redirect_uri': self.get_redirect_uri(state),
-            'scope':self.get_scope_argument()
+            'scope': self.get_scope_argument()
         }
 
     def get_user_id(self, details, response):
@@ -67,4 +71,4 @@ class NKOAuth2(BaseOAuth2):
                       callback_uri=self.get_redirect_uri(state),
                       verifier=oauth_verifier,
                       signature_type=signature_type,
-                      decoding=decoding)
\ No newline at end of file
+                      decoding=decoding)

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