From 6c466dc0f612e7f90179cd8d80f7866d59aa7298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B5=D0=BD=D0=B8=D1=81=20=D0=9A=D1=80=D0=B8=D0=B2?= =?UTF-8?q?=D0=BE=D1=87=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Fri, 31 Jul 2026 01:12:28 +0700 Subject: [PATCH] fix: use correct config reference for email alerts --- transcription_bot/handlers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/transcription_bot/handlers.py b/transcription_bot/handlers.py index 703ebe7..7b1760a 100644 --- a/transcription_bot/handlers.py +++ b/transcription_bot/handlers.py @@ -42,13 +42,13 @@ def _transcription_log_and_notify_email(action: str, error_details: str): import smtplib from email.mime.text import MIMEText msg = MIMEMultipart() - msg['From'] = str(getattr(config.config, 'DEFAULT_EMAIL_FROM', 'bot@noreply.com')) - to_emails = getattr(config.config, 'ALERTS_SUPPORT_EMAILS', ['admin@example.com']) + msg['From'] = str(getattr(config, 'DEFAULT_EMAIL_FROM', 'bot@noreply.com')) + to_emails = getattr(config, 'ALERTS_SUPPORT_EMAILS', ['admin@example.com']) msg['To'] = ', '.join(to_emails) if isinstance(to_emails, list) else str(to_emails) msg['Subject'] = f'TrueConf Bot Error: Транскрипция - {action}' body = f'Обнаружена ошибка в транскрипции.\nВремя: {timestamp}\nДействие: {action}\nДетали:\n{error_details}' msg.attach(MIMEText(body, 'plain', 'utf-8')) - with smtplib.SMTP(getattr(config.config, 'SMTP_SERVER', 'localhost'), int(getattr(config.config, 'SMTP_PORT', 25))) as server: + with smtplib.SMTP(getattr(config, 'SMTP_SERVER', 'localhost'), int(getattr(config, 'SMTP_PORT', 25))) as server: server.send_message(msg) except Exception: pass @@ -163,3 +163,4 @@ async def transcription_handler(msg: Message): +