fix: check booked slots against both day and time
This commit is contained in:
@@ -46,11 +46,13 @@ def get_schedule(course, date):
|
|||||||
booked_slots = frappe.get_all(
|
booked_slots = frappe.get_all(
|
||||||
"LMS Certificate Request",
|
"LMS Certificate Request",
|
||||||
filters={"evaluator": evaluator, "date": date},
|
filters={"evaluator": evaluator, "date": date},
|
||||||
fields=["start_time"],
|
fields=["start_time", "day"],
|
||||||
)
|
)
|
||||||
|
|
||||||
for slot in booked_slots:
|
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):
|
if len(same_slot):
|
||||||
all_slots.remove(same_slot[0])
|
all_slots.remove(same_slot[0])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user