Skip to content

Commit d880e10

Browse files
committed
Fixed issue #3
Fixed scheduling conflict where booking an earlier slot restricts the availability of a later slot, but not vice versa
1 parent 179a481 commit d880e10

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

appointment/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def get_available_slots(date, appointments):
8383
for appointment in appointments:
8484
appointment_start_time = appointment.get_start_time()
8585
appointment_end_time = appointment.get_end_time()
86-
slots = [slot for slot in slots if not (appointment_start_time <= slot <= appointment_end_time)]
86+
slots = [slot for slot in slots if
87+
not (appointment_start_time < slot + slot_duration and slot < appointment_end_time)]
8788
return [slot.strftime('%I:%M %p') for slot in slots]
8889

8990
@staticmethod

0 commit comments

Comments
 (0)