From 9245f928dcb024e2db939bb2a347fcd807cacee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhn-Vitus=20Sa=C3=9F?= Date: Mon, 21 Apr 2025 11:54:30 +0200 Subject: [PATCH] Fix: Error when creating question without image --- django/library/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/library/views.py b/django/library/views.py index 03cab19..0f05e0d 100644 --- a/django/library/views.py +++ b/django/library/views.py @@ -316,7 +316,7 @@ def new_question(request): if request.method == 'POST': question_text = request.POST.get('question', '') - question_image = request.FILES['question_image'] + question_image = request.FILES.get('question_image', None) # Handle different question types if question_type == 'true_false':