fix: pass user_id=None in scheduler sync log to avoid FK constraint

sync_wa_log.user_id has a FK to users; passing 0 fails since no user
with id=0 exists. Scheduler runs without a user context, so use NULL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-17 09:25:17 -05:00
co-authored by Claude Sonnet 4.6
parent 863e012c12
commit 29b6aa4016
+1 -1
View File
@@ -168,7 +168,7 @@ async def sync_recientes(ventana_min: int = 2) -> dict:
modo="upsert", examenes_map=examenes_map)
if resultado["total"] > 0:
guardar_sync_log(resultado, 0, origen="scheduler", modo="upsert")
guardar_sync_log(resultado, None, origen="scheduler", modo="upsert")
return {
"ok": True,