From 0d758b07ea14dfec60a28cf88e111287dae35075 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Oct 2025 12:44:54 +0000 Subject: [PATCH] Fix KeyError in Phase 3 recreate: use str(frnr) for adv_map key - adv_map keys are str, frnr is int, so adv_map[str(frnr)] fixes KeyError --- bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py b/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py index 19e709b3..c6674dce 100644 --- a/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py +++ b/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py @@ -555,7 +555,7 @@ async def handler(event, context): elif row['source_system'] == 'advoware': # Recreate in Google try: - new_event_id = await create_google_event(service, calendar_id, standardize_appointment_data(adv_map[frnr], 'advoware')) + new_event_id = await create_google_event(service, calendar_id, standardize_appointment_data(adv_map[str(frnr)], 'advoware')) async with conn.transaction(): await conn.execute("UPDATE calendar_sync SET google_event_id = $1, sync_status = 'synced', last_sync = $3 WHERE sync_id = $2;", new_event_id, row['sync_id'], datetime.datetime.now(BERLIN_TZ)) logger.info(f"Phase 3: Recreated Google event {new_event_id} for sync_id {row['sync_id']}")