From 9f25db678dcec4e12b83cd6657d9a2eaa8da3ddb Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Wed, 13 Mar 2024 12:34:35 +0530 Subject: [PATCH 1/2] fix: edge case where no year_start_date is not present in academic year --- .../student_monthly_attendance_sheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/education/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py b/education/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py index 37e77e1d..ea9d4916 100644 --- a/education/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py +++ b/education/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py @@ -158,7 +158,7 @@ def mark_holidays(att_map, from_date, to_date, students_list): def get_year_list(): all_academic_years = frappe.db.get_list("Academic Year", pluck="year_start_date") - year_list = [date.year for date in all_academic_years] + year_list = [date.year for date in all_academic_years if date] year_list = list(set(year_list)) year_list.sort() From e1b3769d322167452229e236f7cf2969ea23349e Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Wed, 13 Mar 2024 12:43:08 +0530 Subject: [PATCH 2/2] chore: remove print statement --- education/education/api.py | 3 --- .../student_leave_application/student_leave_application.py | 1 - 2 files changed, 4 deletions(-) diff --git a/education/education/api.py b/education/education/api.py index d5f02109..40797630 100644 --- a/education/education/api.py +++ b/education/education/api.py @@ -618,9 +618,6 @@ def apply_leave_based_on_course_schedule(leave_data, program_name): }, order_by="schedule_date asc", ) - print("-------------------") - print(course_schedule_in_leave_period) - print("-------------------") if frappe.db.exists("Student Attendance", {"course_schedule": "EDU-CSH-2024-00003"}): pass diff --git a/education/education/doctype/student_leave_application/student_leave_application.py b/education/education/doctype/student_leave_application/student_leave_application.py index 24037f6d..aba8e721 100644 --- a/education/education/doctype/student_leave_application/student_leave_application.py +++ b/education/education/doctype/student_leave_application/student_leave_application.py @@ -71,7 +71,6 @@ def update_attendance(self): }, fields=["name"], ) - print("leave_classes", leave_classes) holiday_list = get_holiday_list()