+# -*- coding: utf-8 -*-
+# This file is part of KOED-Quiz, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
from django.shortcuts import get_object_or_404, render, redirect
from quiz.forms import QuestionForm
cur_index = ticket.index(request.path)
if cur_index:
previous_url = ticket[cur_index - 1]
- else:
+ elif ticket:
valid_url = ticket[-1]
if request.method == 'POST' and valid:
cur_index = ticket.index(request.path)
if cur_index:
previous_url = ticket[cur_index - 1]
- else:
+ elif ticket:
valid_url = ticket[-1]
-
result = get_object_or_404(Quiz.current().result_set, slug=slug)
return render(request, "quiz/result_detail.html", locals())