From be0d1f2348f2a2193fae4b1f70edb8f65ea69980 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 26 Sep 2011 14:45:16 +0200 Subject: [PATCH 1/1] session mgmt fix --- apps/quiz/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/quiz/views.py b/apps/quiz/views.py index 037f0c5..830798d 100644 --- a/apps/quiz/views.py +++ b/apps/quiz/views.py @@ -11,9 +11,9 @@ def question(request, slug=None): else: question = get_object_or_404(Quiz.current().question_set, slug=slug) - ticket = request.session.get('ticket') + ticket = request.session.get('ticket', []) valid = request.path in ticket - print ticket, valid + if valid: cur_index = ticket.index(request.path) if cur_index: @@ -44,7 +44,7 @@ def question(request, slug=None): def result(request, slug=None): - ticket = request.session['ticket'] + ticket = request.session.get('ticket', []) valid = request.path in ticket if valid: -- 2.20.1