From 3b195eb763fa7cdc2362ae6364ec0feab814de4f Mon Sep 17 00:00:00 2001 From: Taizo 'Tsa6' Simpson Date: Mon, 25 Sep 2017 18:08:43 -0400 Subject: [PATCH] Added user display name to session on login --- LandingPage/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LandingPage/views.py b/LandingPage/views.py index dd4be9f..2a0563e 100644 --- a/LandingPage/views.py +++ b/LandingPage/views.py @@ -50,6 +50,7 @@ class LoginRedirect(View): ).json() req.session['user_id'] = user_info['uuid'] matches = User.objects.filter(user_id=user_info['uuid']) + match = None if not len(matches): user = User( user_id = user_info['uuid'], @@ -57,7 +58,11 @@ class LoginRedirect(View): display_name = user_info['display_name'] ) user.save() + match = user + else: + match = matches[0] req.session['token'] = resp_json['access_token'] + req.session['disp_name'] = match.display_name return HttpResponseRedirect('/') else: return HttpResponse('

Unmatching state tokens


It looks like the request to login wasn\'t started by you. Try going back to the home page and logging in again.

', status=400)