fix: check booked slots against both day and time

This commit is contained in:
Jannat Patel
2023-07-17 14:28:25 +05:30
parent 71d421898d
commit 295feccb49

View File

@@ -46,11 +46,13 @@ def get_schedule(course, date):
booked_slots = frappe.get_all(
"LMS Certificate Request",
filters={"evaluator": evaluator, "date": date},
fields=["start_time"],
fields=["start_time", "day"],
)
for slot in booked_slots:
same_slot = list(filter(lambda x: x.start_time == slot.start_time, all_slots))
same_slot = list(
filter(lambda x: x.start_time == slot.start_time and x.day == slot.day, all_slots)
)
if len(same_slot):
all_slots.remove(same_slot[0])