]> git.parisson.com Git - django-social-auth.git/commitdiff
Misc
authorMatías Aguirre <matiasaguirre@gmail.com>
Wed, 4 Jul 2012 06:39:19 +0000 (03:39 -0300)
committerMatías Aguirre <matiasaguirre@gmail.com>
Wed, 4 Jul 2012 06:39:19 +0000 (03:39 -0300)
social_auth/backends/__init__.py
social_auth/backends/contrib/douban.py
social_auth/backends/contrib/evernote.py
social_auth/backends/google.py

index d70f51e66264ea7ed5a541442250851aa5586434..a32b403422f4f330abfbbf7d7269f9c14bfab4f6 100644 (file)
@@ -331,7 +331,6 @@ class BaseAuth(object):
 
         @AUTH_BACKEND   Authorization backend related with this service
     """
-
     AUTH_BACKEND = None
 
     def __init__(self, request, redirect):
index 2be91cb973280598928761e02d9896be33ab5122..a380aaa44ef423a9d9f8a41e2da6a37ca8050bf7 100644 (file)
@@ -16,20 +16,23 @@ from social_auth.backends.exceptions import AuthCanceled
 \r
 \r
 DOUBAN_SERVER = 'www.douban.com'\r
-DOUBAN_REQUEST_TOKEN_URL = 'http://%s/service/auth/request_token' % DOUBAN_SERVER\r
-DOUBAN_ACCESS_TOKEN_URL = 'http://%s/service/auth/access_token' % DOUBAN_SERVER\r
+DOUBAN_REQUEST_TOKEN_URL = 'http://%s/service/auth/request_token' % \\r
+                                DOUBAN_SERVER\r
+DOUBAN_ACCESS_TOKEN_URL = 'http://%s/service/auth/access_token' % \\r
+                                DOUBAN_SERVER\r
 \r
-DOUBAN_AUTHORIZATION_URL = 'http://%s/service/auth/authorize' % DOUBAN_SERVER\r
+DOUBAN_AUTHORIZATION_URL = 'http://%s/service/auth/authorize' % \\r
+                                DOUBAN_SERVER\r
 \r
 \r
 class DoubanBackend(OAuthBackend):\r
     """Douban OAuth authentication backend"""\r
     name = 'douban'\r
     EXTRA_DATA = [('id', 'id')]\r
-    \r
+\r
     def get_user_id(self, details, response):\r
         return response['db:uid']['$t']\r
-    \r
+\r
     def get_user_details(self, response):\r
         """Return user details from Douban"""\r
         return {USERNAME: response["db:uid"]["$t"],\r
@@ -51,7 +54,7 @@ class DoubanAuth(ConsumerBasedOAuth):
         url = 'http://api.douban.com/people/%40me?&alt=json'\r
         request = self.oauth_request(access_token, url)\r
         json = self.fetch_response(request)\r
-    \r
+\r
         try:\r
             return simplejson.loads(json)\r
         except ValueError:\r
index 71d93730ac2561fca3a54117532e4a1cf96921fa..1429d1dc2ab37c3384d61e007b4eabf8a9e0c751 100644 (file)
@@ -13,8 +13,8 @@ except ImportError:
 
 from oauth2 import Token
 from social_auth.utils import setting
-from social_auth.backends import ConsumerBasedOAuth, OAuthBackend, USERNAME,\
-        exceptions
+from social_auth.backends import ConsumerBasedOAuth, OAuthBackend, USERNAME, \
+                                 exceptions
 
 
 if setting('EVERNOTE_DEBUG', False):
index 01e8701f08ff6ae65331e4f2ffe56cb01eab8d16..295a3db5e4247d7735ef8c7643d736c791aa126b 100644 (file)
@@ -76,7 +76,8 @@ class GoogleOAuth2Backend(GoogleOAuthBackend):
 
     def get_user_id(self, details, response):
         """Use google email or id as unique id"""
-        user_id = super(GoogleOAuth2Backend, self).get_user_id(details, response)
+        user_id = super(GoogleOAuth2Backend, self).get_user_id(details,
+                                                               response)
         if setting('GOOGLE_OAUTH2_USE_UNIQUE_USER_ID', False):
             return response['id']
         return user_id