From 8460138bf2944ce2ae46f01fda133207e7ec709b Mon Sep 17 00:00:00 2001 From: rutvikrj26 Date: Tue, 16 Jul 2024 12:47:45 -0400 Subject: [PATCH] Updated the view logic to fix the crashing behavior on start --- physionet-django/training/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/physionet-django/training/views.py b/physionet-django/training/views.py index 39eb752325..ea956fa217 100644 --- a/physionet-django/training/views.py +++ b/physionet-django/training/views.py @@ -282,6 +282,10 @@ def current_module_block(request, training_slug, module_order, order): return redirect('current_module_block', training_slug, module_order, module_progress.get_next_content_or_quiz().order) + # if the order is smaller than the minimum order, redirect to the minimum order + if order < module_minimum_order: + return redirect('current_module_block', training_slug, module_order, module_minimum_order) + # check if this is a post request, if so, handle the update of the submission if request.method == 'POST': # if it contains choice, then it is a quiz