From a38402038830bfd897c601744544917801737b4f Mon Sep 17 00:00:00 2001 From: Rami Sayar Date: Thu, 28 Jun 2012 08:19:18 -0700 Subject: [PATCH] Handle set_expiry overflow error. --- social_auth/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/social_auth/views.py b/social_auth/views.py index 23d78b4..b38a148 100644 --- a/social_auth/views.py +++ b/social_auth/views.py @@ -118,7 +118,11 @@ def complete_process(request, backend, *args, **kwargs): # setting. Use last social-auth instance for current provider, # users can associate several accounts with a same provider. if social_user.expiration_delta(): - request.session.set_expiry(social_user.expiration_delta()) + try: + request.session.set_expiry(social_user.expiration_delta()) + except OverflowError: + # Handle django time zone overflow, set default expiry. + request.session.set_expiry(None) # store last login backend name in session key = setting('SOCIAL_AUTH_LAST_LOGIN', -- 2.39.5