]> git.parisson.com Git - django-social-auth.git/commitdiff
fixes an UnboundLocalError that occours when SOCIAL_AUTH_SESSION_EXPIRATION is set...
authorFlavio Curella <flavio.curella@gmail.com>
Mon, 20 Jun 2011 21:00:58 +0000 (14:00 -0700)
committerFlavio Curella <flavio.curella@gmail.com>
Mon, 20 Jun 2011 21:00:58 +0000 (14:00 -0700)
social_auth/views.py

index 62a72384a1e4f01aa0ec61557065222c4c3b6b06..dede174894e9f34cee743fa921ea1c0a75f56d7d 100644 (file)
@@ -48,6 +48,8 @@ def complete_process(request, backend):
 
     if user and getattr(user, 'is_active', True):
         login(request, user)
+        social_user = user.social_user
+
         if getattr(settings, 'SOCIAL_AUTH_SESSION_EXPIRATION', True):
             # Set session expiration date if present and not disabled by
             # setting. Use last social-auth instance for current provider,
@@ -55,7 +57,6 @@ def complete_process(request, backend):
             #
             # user.social_user is the used UserSocialAuth instance defined
             # in authenticate process
-            social_user = user.social_user
             if social_user.expiration_delta():
                 request.session.set_expiry(social_user.expiration_delta())