From 20706c6271be3d6d6c1a2f8d4faabf3ef5d84b93 Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Tue, 28 Aug 2018 12:03:17 -0400 Subject: [PATCH] Set timezone in session as early as possible --- brutaldon/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brutaldon/views.py b/brutaldon/views.py index 60354dc..046e300 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -196,6 +196,8 @@ def oauth_callback(request): preferences = Preference(theme = Theme.objects.get(id=1)) preferences.save() account.preferences = preferences + else: + request.session['timezone'] = account.preferences.timezone account.save() except (Account.DoesNotExist, Account.MultipleObjectsReturned): preferences = Preference(theme = Theme.objects.get(id=1)) @@ -265,6 +267,7 @@ def old_login(request): request.session['user'] = user request.session['username'] = user.username account.username = user.username + request.session['timezone'] = account.preferences.timezone; account.save() return redirect(home)