From 603c29c8b4210029efbb38e9953470bf5223ca89 Mon Sep 17 00:00:00 2001 From: Jonas Obrist Date: Sat, 18 Aug 2012 17:23:15 +0200 Subject: [PATCH] detect logged in users on the home page (mostly debugging social auth) --- templates/login.html | 4 ++++ views.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/login.html b/templates/login.html index 66cb19a..033e323 100644 --- a/templates/login.html +++ b/templates/login.html @@ -15,8 +15,12 @@
+ {% if request.user.is_authenticated %} +

Welcome back, {{ request.user.username }}

+ {% else %} Login with GitHub + {% endif %}
diff --git a/views.py b/views.py index 724e256..a536f83 100644 --- a/views.py +++ b/views.py @@ -12,7 +12,7 @@ def index(request): # Set a test cookie. When the user clicks the 'Login' button, test and make # sure this cookie was set properly. request.session.set_test_cookie() - return render_to_response('login.html') + return render_to_response('login.html', RequestContext(request)) def login(request):