From: Radek Czajka Date: Mon, 26 Sep 2011 12:45:16 +0000 (+0200) Subject: session mgmt fix X-Git-Url: https://git.mdrn.pl/koed-quiz.git/commitdiff_plain/be0d1f2348f2a2193fae4b1f70edb8f65ea69980?hp=7c0b069529d4c0ebe9c398ac733b445ff24495ad session mgmt fix --- 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: