Update question prefetching logic to include 'sbas' app

This commit is contained in:
Ross
2026-02-02 17:12:23 +00:00
parent 6d5303cd0d
commit c2c8ec5b13
+1 -1
View File
@@ -3576,7 +3576,7 @@ class ExamViews(View, LoginRequiredMixin):
# Load questions; prefetch 'answers' for apps that use them to avoid repeated DB hits # Load questions; prefetch 'answers' for apps that use them to avoid repeated DB hits
questions_qs = exam.get_questions() questions_qs = exam.get_questions()
if self.app_name not in ("physics",): if self.app_name not in ("physics", "sbas"):
questions_qs = questions_qs.prefetch_related("answers") questions_qs = questions_qs.prefetch_related("answers")
# Materialize questions list for iteration # Materialize questions list for iteration