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
This commit is contained in:
@@ -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']}")
|
||||
|
||||
Reference in New Issue
Block a user