Fix schedule-info 500: pass db session to medium/low priority date fns

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 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-15 09:37:43 +00:00
parent cab1a39503
commit 7d0b7d2d3b

View file

@ -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')