Aug 4 - Update code to follow up - MT11

This commit is contained in:
2026-08-04 13:00:21 -04:00
parent ceb0b806af
commit 3c2489e289
10 changed files with 1468 additions and 49 deletions
+7 -5
View File
@@ -146,11 +146,13 @@ def _fulfill_schedule(inspection):
"""Roll the originating schedule forward. Caller commits.
Mirrors routes/inspections.py exactly, including passing `_compute_next_run`
as `next_run_fn`. That argument is NOT optional in practice: MT's
`InspectionSchedule.fulfill()` leaves `next_run_at` untouched when it is
omitted, so the schedule would stay permanently due and keep firing overdue
reminders. The deferred import mirrors the web route and avoids a module-load
cycle between the api and routes packages.
as `next_run_fn`. As of phase46 that argument is accepted and ignored: the
cadence maths moved onto `InspectionSchedule.advance_due_date()`, which owns
the recurrence columns and the end-date boundary. Before phase46 omitting it
silently left `next_run_at` untouched and the schedule stayed permanently
due; the call is kept as-is so this file needs no behavioural change. The
deferred import mirrors the web route and avoids a module-load cycle between
the api and routes packages.
"""
if not inspection.inspection_schedule_id:
return