From 6d763f2db58275b4851e04a62879d980ad162a89 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 19 Feb 2024 17:35:36 -0600 Subject: [PATCH] Fix div by 0 --- judge/views/course.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge/views/course.py b/judge/views/course.py index fb31aa7..8ab5c92 100644 --- a/judge/views/course.py +++ b/judge/views/course.py @@ -60,7 +60,7 @@ def calculate_lessons_progress(profile, lessons): res["total"] = { "achieved_points": total_achieved_points, "total_points": total_points, - "percentage": total_achieved_points / total_points * 100, + "percentage": total_achieved_points / total_points * 100 if total_points else 0, } return res