fix: compare timedeltas directly

This commit is contained in:
Himanshu Warekar 2019-05-07 23:42:38 +05:30
parent 1bfef6a600
commit fc3232a9db

View File

@ -65,9 +65,7 @@ class ServiceLevel(Document):
support_days.append(support_and_resolution.workday) support_days.append(support_and_resolution.workday)
support_and_resolution.idx = week.index(support_and_resolution.workday) + 1 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(), if support_and_resolution.start_time >= support_and_resolution.end_time:
datetime.strptime(support_and_resolution.end_time, '%H:%M:%S').time())
if start_time >= end_time:
frappe.throw(_("Start Time can't be greater than or equal to End Time \ frappe.throw(_("Start Time can't be greater than or equal to End Time \
for {0}.".format(support_and_resolution.workday))) for {0}.".format(support_and_resolution.workday)))