corrige zona horaria en votación: TZ=America/Santiago en contenedor

El contenedor corría en UTC causando que la ventana horaria no
coincidiera con la hora local. Se agrega TZ en docker-compose y se
muestra la hora actual del servidor en el panel de votación.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-23 18:16:39 -04:00
parent 2abe7b47fd
commit 36a40938c7
3 changed files with 19 additions and 6 deletions
+6
View File
@@ -244,6 +244,7 @@ def voting_admin(request: Request, db: Session = Depends(get_db)):
"config": config,
"results": results,
"total_votes": total_votes,
"server_time": datetime.now().strftime("%H:%M:%S"),
"error": None,
"success": None,
},
@@ -261,6 +262,8 @@ def update_voting_config(
_require_admin(request)
config = _get_or_create_config(db)
now_str = datetime.now().strftime("%H:%M:%S")
try:
datetime.strptime(start_time, "%H:%M")
datetime.strptime(end_time, "%H:%M")
@@ -273,6 +276,7 @@ def update_voting_config(
"config": config,
"results": results,
"total_votes": sum(r["votes"] for r in results),
"server_time": now_str,
"error": "Formato de hora inválido. Use HH:MM",
"success": None,
},
@@ -288,6 +292,7 @@ def update_voting_config(
"config": config,
"results": results,
"total_votes": sum(r["votes"] for r in results),
"server_time": now_str,
"error": "La hora de inicio debe ser anterior a la hora de fin",
"success": None,
},
@@ -307,6 +312,7 @@ def update_voting_config(
"config": config,
"results": results,
"total_votes": sum(r["votes"] for r in results),
"server_time": now_str,
"error": None,
"success": "Configuración guardada",
},