]> git.parisson.com Git - django-social-auth.git/commitdiff
cosmetics
authorroot <root@ubuntu.localdomain>
Fri, 29 Jul 2011 05:58:59 +0000 (12:58 +0700)
committerroot <root@ubuntu.localdomain>
Fri, 29 Jul 2011 05:58:59 +0000 (12:58 +0700)
social_auth/backends/__init__.py
social_auth/backends/contrib/vkontakte.py
social_auth/backends/facebook.py

index bb9868a177b994d200130cd0de32bde6fc862e6f..612f738a90606e6d3bb5c30e2fb5693f6553e324 100644 (file)
@@ -232,13 +232,14 @@ class SocialAuthBackend(ModelBackend):
 
         kwargs = {'sender': self.__class__, 'user': user,
                   'response': response, 'details': details}
-        changed |= any(filter(signal_response, pre_update.send(**kwargs)))
 
         # Fire socialauth_registered signal on new user registration
         if is_new:
             changed |= any(filter(signal_response,
                                   socialauth_registered.send(**kwargs)))
 
+        changed |= any(filter(signal_response, pre_update.send(**kwargs)))
+
         if changed:
             user.save()
 
index 5d9191c0ad31c278ab4668711a5e142a321dd31d..1e183286d0eaacbac47fc5dfde600f83d9e10a1d 100644 (file)
@@ -16,13 +16,12 @@ from time import time
 
 from social_auth.backends import SocialAuthBackend, OAuthBackend, BaseAuth, BaseOAuth2, USERNAME
 
-VKONTAKTE_LOCAL_HTML  = 'vkontakte.html'
-
 VKONTAKTE_API_URL       = 'https://api.vkontakte.ru/method/'
 VKONTAKTE_OAUTH2_SCOPE  = [''] # Enough for authentication
 
 EXPIRES_NAME = getattr(settings, 'SOCIAL_AUTH_EXPIRATION', 'expires')
 USE_APP_AUTH = getattr(settings, 'VKONTAKTE_APP_AUTH', False)
+LOCAL_HTML = getattr(settings, 'VKONTAKTE_LOCAL_HTML', 'vkontakte.html')
 
 class VKontakteBackend(SocialAuthBackend):
     """VKontakte authentication backend"""
@@ -75,7 +74,7 @@ class VKontakteAuth(BaseAuth):
         dict = { 'VK_APP_ID'      : self.APP_ID,
                  'VK_COMPLETE_URL': reverse(settings.SOCIAL_AUTH_COMPLETE_URL_NAME, args=[VKontakteBackend.name]) }
         
-        vk_template = loader.get_template(VKONTAKTE_LOCAL_HTML)
+        vk_template = loader.get_template(LOCAL_HTML)
         context = RequestContext(self.request, dict)
     
         return vk_template.render(context)
index 070f7c5505eaaeeb3af199504878fa85e55884a8..aa7f6f1670315c94882f82b0c720b26c1f6fe8e1 100644 (file)
@@ -61,11 +61,10 @@ class FacebookAuth(BaseOAuth):
         return FACEBOOK_AUTHORIZATION_URL + '?' + urllib.urlencode(args)
 
     def auth_complete(self, *args, **kwargs):
+        """Returns user, might be logged in"""
         access_token = None
         expires = None
-        
-        """Returns user, might be logged in"""
-        
+
         if 'code' in self.data:
             url = FACEBOOK_ACCESS_TOKEN_URL + '?' + \
                   urllib.urlencode({'client_id': settings.FACEBOOK_APP_ID,