From c96a14c972a0b8cdb892694df2a6251ed641e9f9 Mon Sep 17 00:00:00 2001 From: Anand Chitipothu Date: Tue, 1 Jun 2021 08:15:52 +0530 Subject: [PATCH] feat: ignore orphan exercises in the progress Don't show exercises that are not added to any lesson in the progress. --- community/www/batch/progress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community/www/batch/progress.py b/community/www/batch/progress.py index af22ede5..adfb72dd 100644 --- a/community/www/batch/progress.py +++ b/community/www/batch/progress.py @@ -25,7 +25,7 @@ class BatchReport: self.submissions_by_exercise[s.exercise].append(s) def get_exercises(self, course_name): - return frappe.get_all("Exercise", {"course": course_name}, ["name", "title", "index_label"], order_by="index_label") + return frappe.get_all("Exercise", {"course": course_name, "lesson": ["!=", ""]}, ["name", "title", "index_label"], order_by="index_label") def get_submissions_of_exercise(self, exercise_name): return self.submissions_by_exercise[exercise_name]