Description
get_next_unit() raises an unhandled QuestionPaper.DoesNotExist error
("QuestionPaper not found") when a student moves to next quiz unit
that has no associated QuestionPaper.
the quiz:
Expected Behavior
Should not crash. Instead, redirect the user gracefully
when no QuestionPaper is available.
Fix
Replace .get() with .first() and add a None check:
Add Test
Description
get_next_unit()raises an unhandledQuestionPaper.DoesNotExisterror("QuestionPaper not found") when a student moves to next quiz unit
that has no associated
QuestionPaper.the quiz:
Expected Behavior
Should not crash. Instead, redirect the user gracefully
when no
QuestionPaperis available.Fix
Replace
.get()with.first()and add aNonecheck:Add Test