From 7d0b7d2d3b5091b3e467d564db318aca94377690 Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Wed, 15 Jul 2026 09:37:43 +0000 Subject: [PATCH] Fix schedule-info 500: pass db session to medium/low priority date fns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_medium_priority_dates and get_low_priority_dates both require a SyncSession argument; the endpoint was calling them without one, causing a TypeError → 500 on every load of the schedule card. Co-Authored-By: Claude Sonnet 4.6 --- backend/api/competitors.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/api/competitors.py b/backend/api/competitors.py index 09b176d..1afa637 100644 --- a/backend/api/competitors.py +++ b/backend/api/competitors.py @@ -1192,8 +1192,12 @@ async def get_schedule_info( # Calculate what today's schedule would look like from jobs.scrape_booking_rates import get_high_priority_dates, get_medium_priority_dates, get_low_priority_dates high = get_high_priority_dates() - medium = get_medium_priority_dates() - low = get_low_priority_dates() + sync_db = SyncSessionLocal() + try: + medium = get_medium_priority_dates(sync_db) + low = get_low_priority_dates(sync_db) + finally: + sync_db.close() today = date.today() weekday_name = today.strftime('%A')