Availability and conflicts¶
Applies to: Owner, Administrator, Manager, Receptionist, Instructor. Last reviewed: 2026-11-18.
This page explains how DriveFlow decides whether a lesson can be booked at a given time, and lists the exact messages you see when it cannot.
The short version¶
A lesson is accepted only when all of the following are true:
- The student may take lessons and has lessons left.
- The branch is open and the whole lesson fits inside its working hours.
- The start time is on a booking slot and inside the booking window.
- The student, the instructor and the vehicle are each free, with the required gap around their other lessons.
- The instructor works at the student's branch, is active, and is approved for the student's licence code.
- The vehicle can be used at the student's branch, is active, and suits the licence code.
The same checks run for a lesson booked by staff, a lesson requested by a student, a lesson moved by drag and drop, and a student's change request. Two lighter paths exist and are described under Paths that check less.
Which times are compared¶
All lesson times are stored as the branch's local clock time. "Now" and "today" are the branch's own time and date, not the server's.
1. Rules about the student¶
Student status¶
Lessons can be booked for students in these statuses: Registered, Learners Pending, Learners Passed, Learners Failed, In Training, Training Completed, Ready For Test, Test Booked, Test Failed.
Any other status is refused with: "Student is in status {status} and cannot book lessons."
Learner's licence¶
A student who has a learner's licence that has not expired by the lesson date can be booked freely. A learner's licence with no expiry date recorded is treated as valid.
A student without a valid learner's licence can only be booked if a learner's test is booked for them, and only on or after the date of that test.
| Situation | Message |
|---|---|
| No learner's licence and no learner's test booked | "This student does not have a learner's licence yet. Book their learner's test first; lessons can then be scheduled from the test date." |
| Lesson date is before the learner's test | "Lessons can only be scheduled on or after the student's learner's test on 14 Dec 2026." |
See Booking a test.
Lesson allowance (package balance)¶
The allowance is the number of lessons in the student's training package plus any extra lessons added to it. Every lesson that is not cancelled counts as used: scheduled, confirmed, in progress, awaiting sign-off, completed and no-show lessons all count. Cancelling a lesson gives it back.
- If the student has an active course, only that course is counted: its package, the extra lessons added to it, and the lessons linked to it. Lessons from an earlier, completed course do not use up the new one.
- If the student has no course, the student's package and all their lessons are counted.
- If the student has no training package at all, no allowance is enforced.
| Situation | Message |
|---|---|
| No lessons left | "Student has no remaining lessons in their training package." |
| Booking several lessons and not enough left | "This booking needs 3 lessons but the student only has 2 lesson(s) remaining in their training package." |
Tip
To book beyond the package, add an extra lesson first (student profile, Lessons tab, Add Extra Lesson). Packages and extra lessons are documented with the package and finance guides.
Training completed¶
Once a student's status is Training Completed, Ready For Test, Test Booked or Test Failed, only extra lessons added after training was completed can be booked. Each booking uses one; cancelling it frees it again.
| Situation | Message |
|---|---|
| No extra lesson available | "This student has completed their training. Add an extra lesson, or start a new course, before scheduling another lesson." |
| Not enough extra lessons for this booking | "This booking needs 2 lessons but the student only has 1 extra lesson(s) left. Add more extra lessons first." |
Lessons per day¶
Each branch sets a Maximum lessons per student per day (default 2). Every lesson that is not cancelled counts towards it.
| Situation | Message |
|---|---|
| Limit reached | "This student already has the maximum of 2 lesson(s) on this day." |
| A double or triple lesson would exceed it | "This booking is 2 lessons, which would take the student over the branch maximum of 2 lesson(s) per day (1 already booked)." |
Student already has a lesson¶
The student cannot have two lessons that overlap, or that are closer together than the branch buffer.
Message: "The student already has a lesson at that time."
A lesson request that is still waiting for approval also counts as the student being busy.
Branch¶
Lessons are always booked at the student's own branch, with that branch's instructors and vehicles.
Message: "This student belongs to a different branch. Lessons can only be booked at the student's own branch."
A user who is tied to one branch cannot book at another: "You do not have access to this branch."
2. Rules about the time¶
| Rule | Setting | Message when broken |
|---|---|---|
| Branch must be open that day | Working Hours | "The branch is closed on the selected day." |
| Lesson must start at or after opening and end at or before closing | Working Hours | "The lesson must fall entirely within branch working hours (08:00 - 17:00)." |
| Start time must be on a slot, counted from opening time | Booking slot interval | "Lessons must start on a 30-minute boundary." |
| Date must not be in the past, must respect same-day booking, and must be within the maximum days ahead | Allow same-day bookings, Maximum advance booking | "The selected date is outside the allowed booking window." |
| Start must be at least the minimum notice from now | Minimum advance booking | "Lessons must be booked at least 2 hour(s) in advance." |
| Branch must have scheduling settings | - | "Scheduling has not been configured for this branch." |
Important
These rules apply to staff as well as students. Staff cannot book a lesson in the past, outside working hours, or inside the minimum notice period.
Slot boundaries are counted from the branch's opening time. With opening at 08:00 and a 30 minute interval, valid starts are 08:00, 08:30, 09:00 and so on. With opening at 08:15, they are 08:15, 08:45, 09:15.
3. How "free" is decided: the boundary rule and the buffer¶
Two lessons clash when one starts before the other ends and ends after the other starts. A lesson that ends at exactly 10:00 does not clash with one that starts at exactly 10:00.
On top of that, the scheduling engine adds the branch's Buffer between lessons to both ends of every existing lesson. The buffer applies separately to the student, the instructor and the vehicle.
| Buffer setting | Existing lesson | Can a new lesson start at 10:00? | Earliest start after it |
|---|---|---|---|
| 0 minutes (default for new branches) | 09:00 - 10:00 | Yes | 10:00 |
| 10 minutes | 09:00 - 10:00 | No | 10:10 (but see slot interval below) |
| 15 minutes | 09:00 - 10:00 | No | 10:15 |
The buffer works together with the slot interval. With a 10 minute buffer and a 30 minute interval, the next start the system will accept after a 09:00 - 10:00 lesson is 10:30, because 10:10 is not on a slot.
A double or triple lesson is reserved as one block, so no buffer is needed between its own lessons.
What holds a time slot¶
For the scheduling engine, a lesson holds its time in every status except Cancelled. A completed or no-show lesson still blocks the instructor, the vehicle and the student for that time.
A student's pending lesson request also holds its instructor, vehicle and student until the school approves or declines it, so the same time is not offered to someone else in the meantime.
4. Rules about the instructor¶
An instructor can take the lesson when all of these are true:
| Check | Detail |
|---|---|
| Same branch | The instructor's branch is the student's branch. |
| Active | The instructor's status is Active. |
| Licence code | The instructor is approved for the lesson's licence code. |
| Working hours | If the instructor has their own weekly working hours recorded, the whole lesson must fall inside them. If they have none, the branch working hours apply. |
| Time off | The lesson must not overlap a recorded time-off period (leave, sick, training, public holiday, other). No buffer is added to time off. |
| No clash | No other lesson or pending request within the buffer. |
| Situation | Message |
|---|---|
| Chosen instructor is at another branch, inactive, or not approved for the licence code | "The selected instructor is not available for this lesson." |
| Chosen instructor is busy, off, or outside working hours | "The instructor is not available at that time." |
| No instructor chosen and auto-assign is off | "An instructor must be selected for this lesson." |
| Auto-assign is on and nobody qualifies | "No qualified instructor is available at that time." |
Instructor working hours and time off cannot be entered
Instructor working hours and time off are read by the scheduling engine, but there is currently no screen in the web application (and no API) to record them. Until they are entered directly in the database, every instructor simply follows the branch working hours. See Scheduling settings.
More detail: Instructor assignment.
5. Rules about the vehicle¶
A vehicle can be used when all of these are true:
| Check | Detail |
|---|---|
| Branch | The vehicle belongs to the student's branch, or is marked as available to all branches. |
| Active | The vehicle's status is Active. |
| Licence code | The vehicle is linked to the lesson's licence code. A vehicle with no licence codes linked is treated as general purpose and suits every code. |
| Ownership | A vehicle owned by an instructor can only be used by that instructor. |
| No clash | No other lesson or pending request within the buffer. |
| Situation | Message |
|---|---|
| Chosen vehicle is at another branch, inactive, or wrong licence code | "The selected vehicle is not suitable for this lesson." |
| Chosen vehicle is busy | "The vehicle is already assigned to another lesson at that time." |
| Vehicle belongs to a different instructor | "This vehicle belongs to another instructor; only its owner can use it." |
| No vehicle chosen and auto-assign is off | "A vehicle must be selected for this lesson." |
| Auto-assign is on and none is free | "No suitable vehicle is available at that time." |
More detail: Vehicle assignment.
6. Licence code matching¶
The lesson's licence code is decided in this order: the student's course, otherwise the student's own licence code.
- It must be enabled for your school: "The licence code is not enabled for this company."
- If none can be found: "No licence code could be determined for this lesson."
- If the training package is tied to a licence code, it must be the same one: "The selected training package is not valid for this licence code."
- The package must be active: "The selected training package is not active."
The instructor must be approved for that code and the vehicle must suit it, as described above.
What you see when no time is available¶
In the Schedule Lesson dialog and in the student portal, the system lists the times it will accept. When a time is left out, the reason is one of these:
| Reason shown | Meaning |
|---|---|
| "The branch is closed on Sunday, or no opening and closing times have been configured for that day." | Whole day blocked. |
| "This date is in the past." | Whole day blocked. |
| "Same-day bookings are not allowed for this branch." | Whole day blocked. |
| "This date is beyond the branch booking window. Bookings are only open up to 17 Jan 2027 (60 days ahead)." | Whole day blocked. |
| "This student already has 2 lesson(s) on this date, which is the branch maximum of 2 per day." | Whole day blocked. |
| "No active instructor at this branch is approved for this licence code." | Whole day blocked. |
| "No active vehicle at this branch is suitable for this licence code." | Whole day blocked. |
| "No start time fits between the branch opening hours (08:00 - 17:00) and the 60 minute lesson length, or every candidate time is inside the 2 hour minimum notice period." | Whole day blocked. |
| "The student already has a lesson at or next to this time (a 10 minute gap is required between lessons)." | One time blocked. |
| "No instructor is free at this time: they are outside their working hours, on leave, or already booked (a 10 minute gap is required between lessons)." | One time blocked. |
| "No vehicle is free at this time: every suitable vehicle is already booked (a 10 minute gap is required between lessons)." | One time blocked. |
Two people booking the same time¶
If two staff members try to book the same instructor, vehicle or student at the same moment, the server checks availability again at the point of saving. Student lesson requests are saved inside a database transaction that locks the time range, so two simultaneous requests cannot both succeed; the second is told "There is already a pending or confirmed booking for the selected time slot." This behaviour is covered by the automated concurrency tests in the code base.
Paths that check less¶
Two actions do not go through the full scheduling engine. They use a simpler check and it is useful to know the difference.
| Action | What is checked | What is not checked |
|---|---|---|
| Edit a lesson (the Edit Lesson dialog) | Student, instructor and vehicle have no overlapping lesson; instructor and vehicle are active and usable at the lesson's branch; instructor-owned vehicle rule. | Working hours, slot boundaries, booking window, minimum notice, buffer, instructor time off, licence code, daily limit, pending requests. Only Scheduled, Confirmed and In Progress lessons count as clashes. |
| Approve a student's lesson request | The request passed the full engine when the student sent it. On approval the instructor and vehicle are re-checked for overlap, plus student status, learner's licence and allowance. | The buffer and working hours are not re-checked at approval. |
Messages from the Edit path are worded differently:
- "Student already has a lesson booked at that time."
- "Instructor is already teaching another lesson at that time."
- "Vehicle is already assigned to another lesson at that time."
- "This instructor works at a different branch from the lesson."
- "This vehicle is not available at the lesson's branch."
Edit can place a lesson where booking would refuse it
Because Edit uses the simpler check, it is possible to edit a lesson to a time the booking dialog would have refused (for example outside working hours, or straight after another lesson when a buffer is set). Use drag and drop on the calendar when you want the full rules applied. See Lesson rescheduling.
Status-date guard¶
Separately from booking, a branch can stop staff from changing a lesson's status before its date. This is the No status changes before the date switch in Scheduling settings, on by default. When on, a lesson cannot be started, signed off, completed or marked as a no-show before the day of the lesson, and a driving test result cannot be recorded before the test date.
Message: "A lesson can't be started before its date (25 Nov 2026). Change it on the day, or switch off "No status changes before the date" under Settings > Scheduling."
The first words change with the action: "A lesson can't be signed off...", "A lesson can't be completed...", "A lesson can't be marked as a no show...", "A driving test result can't be recorded...".
The guard compares dates only. A lesson at 16:00 today can be marked completed at 08:00 today.
Messages you may see¶
A quick index of the booking messages on this page, by cause.
| Cause | Message begins |
|---|---|
| Student status | "Student is in status ..." |
| Learner's licence | "This student does not have a learner's licence yet ..." / "Lessons can only be scheduled on or after ..." |
| Package | "Student has no remaining lessons ..." / "This booking needs ..." |
| Training completed | "This student has completed their training ..." |
| Branch | "This student belongs to a different branch ..." / "Branch is not active." |
| Day closed | "The branch is closed on the selected day." |
| Hours | "The lesson must fall entirely within branch working hours ..." |
| Slot | "Lessons must start on a ...-minute boundary." |
| Window | "The selected date is outside the allowed booking window." |
| Notice | "Lessons must be booked at least ..." |
| Daily limit | "This student already has the maximum of ..." |
| Student busy | "The student already has a lesson at that time." |
| Instructor | "The selected instructor is not available for this lesson." / "The instructor is not available at that time." |
| Vehicle | "The selected vehicle is not suitable for this lesson." / "The vehicle is already assigned to another lesson at that time." |
| Own lessons only | "You can only schedule your own lessons." |
Limitations and notes¶
- Instructor working hours and time off cannot be captured in the web application (see above).
- Driving tests are not part of lesson availability. An instructor or vehicle booked for a driving test is still offered for a lesson at the same time, and the lesson is accepted. Only moving a driving test checks against lessons. See Scheduling a test.
- The instructor list in the booking dialog hides instructors with any overlapping lesson but does not apply the buffer, working hours or time off; the vehicle list is not filtered by time at all. The save is what counts.
Related articles¶
- Scheduling lessons - booking a lesson step by step.
- Scheduling settings - working hours, slots, buffer and booking window.
- Lesson rescheduling - moving lessons with the full or basic rules.
- Bookings and online requests - lessons requested by students.
- Instructor availability - the instructor side of availability.
- Vehicle availability - the vehicle side of availability.