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:
@@ -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",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user