From 58fff94bc6025629e4d5bebd5b89090b94bfe9eb Mon Sep 17 00:00:00 2001
From: hardythe1
Date: Tue, 7 Jul 2015 17:03:29 +0530
Subject: on logout redirect to cfp
---
website/templates/cfp.html | 2 +-
website/urls.py | 1 +
website/views.py | 9 +++++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/website/templates/cfp.html b/website/templates/cfp.html
index c584cc5..cea8f56 100644
--- a/website/templates/cfp.html
+++ b/website/templates/cfp.html
@@ -17,7 +17,7 @@
{{ user.get_full_name|default:user.username }}
{% endif %}
diff --git a/website/urls.py b/website/urls.py
index d3e2508..05266c1 100644
--- a/website/urls.py
+++ b/website/urls.py
@@ -5,4 +5,5 @@ urlpatterns = patterns('',
url(r'^$', 'website.views.home', name='home'),
url(r'^cfp$', 'website.views.cfp', name='cfp'),
url(r'^submit-cfp$', 'website.views.submitcfp', name='submitcfp'),
+ url(r'^logout$', 'website.views.userlogout', name='userlogout'),
)
diff --git a/website/views.py b/website/views.py
index c793c09..dfec67c 100644
--- a/website/views.py
+++ b/website/views.py
@@ -40,6 +40,15 @@ def cfp(request):
'user': request.user})
return render_to_response('cfp.html',
context_instance=context)
+
+
+def userlogout(request):
+ user = request.user
+ if user.is_authenticated:
+ logout(request)
+ return HttpResponseRedirect("/cfp")
+ else:
+ return HttpResponseRedirect("/cfp")
def submitcfp(request):
--
cgit