Fix frontend

This commit is contained in:
2026-03-19 17:12:39 +01:00
parent be5ef212e9
commit 106ed50361
3 changed files with 19 additions and 19 deletions
@@ -10,12 +10,12 @@ Testa:
4. Test via NotificationService.test_channel (flusso completo)
Eseguire DENTRO il container backend:
docker exec pecflow-backend-1 python \
docker exec pechub-backend-1 python \
/app/tests/integration/test_telegram_real.py
Oppure specificando credenziali manuali via env:
docker exec -e TELEGRAM_BOT_TOKEN=xxx -e TELEGRAM_CHAT_ID=-100yyy \
pecflow-backend-1 python /app/tests/integration/test_telegram_real.py
pechub-backend-1 python /app/tests/integration/test_telegram_real.py
"""
import asyncio
@@ -28,7 +28,7 @@ from datetime import datetime
# ─── Variabili d'ambiente ─────────────────────────────────────────────────────
os.environ.setdefault("ENCRYPTION_KEY", "6465762d656e6372797074696f6e2d6b65792d6e6f742d666f722d70726f6400")
os.environ.setdefault("SECRET_KEY", "dev-secret-key-not-for-production-use-only-for-local-0000000000000")
os.environ.setdefault("DATABASE_URL", "postgresql+asyncpg://pecflow:pecflow_dev_password@db:5432/pecflow")
os.environ.setdefault("DATABASE_URL", "postgresql+asyncpg://pechub:pechub_dev_password@db:5432/pechub")
os.environ.setdefault("REDIS_URL", "redis://redis:6379/0")
os.environ.setdefault("MINIO_ENDPOINT", "minio:9000")
@@ -41,7 +41,7 @@ def _sep(char: str = "─", width: int = 60) -> None:
def _banner(bot_token_masked: str, chat_id: str) -> None:
_sep("")
print(" PecFlow Test Telegram Reale")
print(" PEChub Test Telegram Reale")
_sep("")
print(f" Timestamp : {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
print(f" Bot Token : {bot_token_masked}")
@@ -145,7 +145,7 @@ async def test_direct_send(bot_token: str, chat_id: str) -> bool:
ts = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
text = (
f"🧪 <b>PecFlow Test integrazione</b>\n\n"
f"🧪 <b>PEChub Test integrazione</b>\n\n"
f"Test invio diretto via <code>send_message()</code>\n\n"
f"🕐 <i>{ts}</i>"
)
@@ -201,14 +201,14 @@ async def test_send_test_message(bot_token: str, chat_id: str) -> bool:
from app.notifications.telegram import TelegramError, send_test_message
print(" Chiamata: send_test_message(channel_name='Test PecFlow')")
print(" Chiamata: send_test_message(channel_name='Test PEChub')")
print()
try:
result = await send_test_message(
bot_token=bot_token,
chat_id=chat_id,
channel_name="Test PecFlow",
channel_name="Test PEChub",
)
msg_id = result.get("message_id")
print(f" ✅ INVIO OK message_id={msg_id}")