From 6734dc5252f564deab92e332d0e6328620dc2403 Mon Sep 17 00:00:00 2001 From: Flavio Curella Date: Mon, 20 Jun 2011 14:00:58 -0700 Subject: [PATCH] fixes an UnboundLocalError that occours when SOCIAL_AUTH_SESSION_EXPIRATION is set to False --- social_auth/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/social_auth/views.py b/social_auth/views.py index 62a7238..dede174 100644 --- a/social_auth/views.py +++ b/social_auth/views.py @@ -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()) -- 2.39.5