fix add_notification for blocked users

This commit is contained in:
Vladless
2025-05-20 12:35:54 +03:00
parent 6586940158
commit 9fd47594fc
@@ -402,8 +402,8 @@ async def handle_expired_keys(bot: Bot, conn: asyncpg.Connection, current_time:
results = await send_messages_with_limit(bot, messages, conn=conn)
sent_count = 0
for msg, result in zip(messages, results, strict=False):
await add_notification(msg["tg_id"], msg["notification_id"], session=conn)
if result:
await add_notification(msg["tg_id"], msg["notification_id"], session=conn)
sent_count += 1
logger.info(f"📢 Уведомление об истекшем ключе {msg['email']} отправлено пользователю {msg['tg_id']}.")
else: