From ae7e1c86f06dd221462bb86fb160eb2043216ffb Mon Sep 17 00:00:00 2001 From: FathiaBMExp Date: Mon, 3 Mar 2025 11:16:12 +0100 Subject: [PATCH] fix(system_dashboard_classic): Task 12140 Fix a bug where a datetime.date object is converted to a string and then compared to a datetime.date object. Signed-off-by: FathiaBMExp --- odex25_base/system_dashboard_classic/models/models.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/odex25_base/system_dashboard_classic/models/models.py b/odex25_base/system_dashboard_classic/models/models.py index e5f2c8031..bef86ad86 100644 --- a/odex25_base/system_dashboard_classic/models/models.py +++ b/odex25_base/system_dashboard_classic/models/models.py @@ -118,14 +118,13 @@ class SystemDashboard(models.Model): if not special.date_from and not special.date_to: sepcial_working_hours += special.working_hours days_special_name.append(special.name) - elif not special.date_from and str(t_date) <= special.date_to: + elif not special.date_from and t_date <= special.date_to: sepcial_working_hours += special.working_hours days_special_name.append(special.name) - elif not special.date_to and str(t_date) >= special.date_from: + elif not special.date_to and t_date >= special.date_from: sepcial_working_hours += special.working_hours days_special_name.append(special.name) - elif special.date_from and special.date_to and str(t_date) >= special.date_from and str( - t_date) <= special.date_to: + elif special.date_from and special.date_to and special.date_from <= t_date <= special.date_to: sepcial_working_hours += special.working_hours days_special_name.append(special.name)