[Python-modules-commits] [python-social-auth] 57/89: PEP8 and minor code simplification

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:15:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.15
in repository python-social-auth.

commit 9c8f7094a3439793d1cfbf0a5d65d193890eba8e
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Sun Mar 27 02:43:19 2016 -0300

    PEP8 and minor code simplification
---
 docs/backends/arcgis.rst             | 13 ++++++-------
 social/backends/arcgis.py            |  4 +---
 social/tests/backends/test_arcgis.py | 16 +++++++++-------
 3 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/docs/backends/arcgis.rst b/docs/backends/arcgis.rst
index 6c402cd..1ab43a2 100644
--- a/docs/backends/arcgis.rst
+++ b/docs/backends/arcgis.rst
@@ -11,16 +11,15 @@ OAuth2
 
 1. Add the OAuth2 backend to your settings page::
 
-	AUTHENTICATION_BACKENDS = (
-		...
-		'social.backends.arcgis.ArcGISOAuth2',
-		...
+    AUTHENTICATION_BACKENDS = (
+        ...
+        'social.backends.arcgis.ArcGISOAuth2',
+        ...
     )
 
 2. Fill ``Client Id`` and ``Client Secret`` values in the settings::
 
-      SOCIAL_AUTH_ARCGIS_KEY = ''
-      SOCIAL_AUTH_ARCGIS_SECRET = ''
-
+    SOCIAL_AUTH_ARCGIS_KEY = ''
+    SOCIAL_AUTH_ARCGIS_SECRET = ''
 
 .. _ArcGIS Developer Center: https://developers.arcgis.com/
diff --git a/social/backends/arcgis.py b/social/backends/arcgis.py
index 7f54b3c..1a2b59a 100644
--- a/social/backends/arcgis.py
+++ b/social/backends/arcgis.py
@@ -24,12 +24,10 @@ class ArcGISOAuth2(BaseOAuth2):
 
     def user_data(self, access_token, *args, **kwargs):
         """Loads user data from service"""
-        data = self.get_json(
+        return self.get_json(
             'https://www.arcgis.com/sharing/rest/community/self',
             params={
                 'token': access_token,
                 'f': 'json'
             }
         )
-
-        return data
diff --git a/social/tests/backends/test_arcgis.py b/social/tests/backends/test_arcgis.py
index 39d4b6e..90ca9c3 100644
--- a/social/tests/backends/test_arcgis.py
+++ b/social/tests/backends/test_arcgis.py
@@ -8,16 +8,18 @@ class ArcGISOAuth2Test(OAuth2Test):
     expected_username = 'gis at rocks.com'
 
     user_data_body = json.dumps({
-        "first_name": "Gis",
-        "last_name": "Rocks",
-        "email": "gis at rocks.com",
-        "fullName": "Gis Rocks",
-        "username": "gis at rocks.com"
+        'first_name': 'Gis',
+        'last_name': 'Rocks',
+        'email': 'gis at rocks.com',
+        'fullName': 'Gis Rocks',
+        'username': 'gis at rocks.com'
     })
 
     access_token_body = json.dumps({
-        "access_token": "CM-gcB85taGhRmoI7l3PSGaXUNsaLkTg-dHH7XtA9DnlinPYKBBrIvFzhd1JtDhh7hEwSv_6eLLcLtUqe3gD6i1yaYYFpUQJwy8KEujke5AE87tP9XIoMtp4_l320pUL",
-        "expires_in": 86400
+        'access_token': 'CM-gcB85taGhRmoI7l3PSGaXUNsaLkTg-dHH7XtA9Dnlin' \
+                        'PYKBBrIvFzhd1JtDhh7hEwSv_6eLLcLtUqe3gD6i1yaYYF' \
+                        'pUQJwy8KEujke5AE87tP9XIoMtp4_l320pUL',
+        'expires_in': 86400
     })
 
     def test_login(self):

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