Error message when quiz not found

This commit is contained in:
juhnsa
2025-04-07 17:00:20 +02:00
parent 295c3aa6d5
commit 071e76b3af
3 changed files with 17 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ from django.shortcuts import render, redirect, get_object_or_404, reverse
from play.models import QuizGame, QuizGameParticipant
from library.models import QivipQuiz, QivipQuestion
from django.http import HttpResponseRedirect, HttpResponseNotFound
from django.contrib import messages
import json
@@ -102,8 +103,7 @@ def join_game(request):
return redirect('play:create_participant', join_code=join_code)
return redirect('play:lobby', join_code=join_code)
except QuizGame.DoesNotExist:
# TODO: Mit message eine Fehlermeldung weitergeben (und im entsprechenden Template Designen)
pass
messages.error(request, "Dieses Spiel existiert nicht.")
return render(request, 'play/join_game.html')
def finished(request, join_code):