logging_level/ fix subgroup migrations and more

This commit is contained in:
Vladless
2025-10-12 20:59:18 +03:00
parent 50c73821a6
commit 8d80360615
28 changed files with 462 additions and 281 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ async def store_key(
)
session.add(new_key)
await session.commit()
logger.info(f"Ключ сохранён: tg_id={tg_id}, client_id={client_id}, server_id={server_id}")
logger.info(f"Ключ сохранён: tg_id={tg_id}, client_id={client_id}, server_id={server_id}")
except SQLAlchemyError as e:
logger.error(f"❌ Ошибка при сохранении ключа: {e}")
+1 -1
View File
@@ -40,7 +40,7 @@ async def delete_notification(session: AsyncSession, tg_id: int, notification_ty
)
)
await session.commit()
logger.info(f"🗑 Уведомление {notification_type} для пользователя {tg_id} удалено")
logger.debug(f"🗑 Уведомление {notification_type} для пользователя {tg_id} удалено")
async def check_notification_time(session: AsyncSession, tg_id: int, notification_type: str, hours: int = 12) -> bool:
+3 -1
View File
@@ -44,6 +44,8 @@ async def delete_server(session: AsyncSession, server_name: str):
async def get_servers(session: AsyncSession, include_enabled: bool = False) -> dict:
from handlers.utils import ALLOWED_GROUP_CODES
try:
stmt = select(Server)
result = await session.execute(stmt)
@@ -68,7 +70,7 @@ async def get_servers(session: AsyncSession, include_enabled: bool = False) -> d
for sid, gc in r2.all():
groups_map.setdefault(sid, []).append(gc)
allowed = {"trial", "discounts", "discounts_max"}
allowed = set(ALLOWED_GROUP_CODES)
grouped = {}
for s in servers: