From fc3232a9db03b09b4b622701e33ad866be4e7263 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Tue, 7 May 2019 23:42:38 +0530 Subject: [PATCH] fix: compare timedeltas directly --- erpnext/support/doctype/service_level/service_level.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/erpnext/support/doctype/service_level/service_level.py b/erpnext/support/doctype/service_level/service_level.py index f48d927778..0b903fb052 100644 --- a/erpnext/support/doctype/service_level/service_level.py +++ b/erpnext/support/doctype/service_level/service_level.py @@ -65,9 +65,7 @@ class ServiceLevel(Document): support_days.append(support_and_resolution.workday) support_and_resolution.idx = week.index(support_and_resolution.workday) + 1 - start_time, end_time = (datetime.strptime(support_and_resolution.start_time, '%H:%M:%S').time(), - datetime.strptime(support_and_resolution.end_time, '%H:%M:%S').time()) - if start_time >= end_time: + if support_and_resolution.start_time >= support_and_resolution.end_time: frappe.throw(_("Start Time can't be greater than or equal to End Time \ for {0}.".format(support_and_resolution.workday)))