diff --git a/src/db.sqlite3 b/src/db.sqlite3 index 87a96e3..b30ee91 100644 Binary files a/src/db.sqlite3 and b/src/db.sqlite3 differ diff --git a/src/questions/views.py b/src/questions/views.py index e5c4dd5..6d6e8e6 100644 --- a/src/questions/views.py +++ b/src/questions/views.py @@ -54,9 +54,12 @@ def single(request, id): user_answer.their_importance = "Not Important" user_answer.save() - next_q = Question.objects.all().order_by("?").first() - return redirect("question_single", id=next_q.id) - + next_q = Question.objects.get_unanswered(request.user).order_by("?") + if next_q.count() > 0: + next_q_instance = next_q.first() + return redirect("question_single", id=next_q_instance.id) + else: + return redirect("home") context = { "form": form,