Compare commits
2 Commits
feature/bi
...
cc95ae1a6b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc95ae1a6b | ||
|
|
9ffa5ba0f7 |
@@ -91,13 +91,16 @@ async def last_subscription(telegram_id: int, database_manager: DatabaseManager
|
||||
try:
|
||||
subscription = await database_manager.get_last_subscriptions(telegram_id=telegram_id)
|
||||
|
||||
plan = await database_manager.get_plan_by_id(subscription.plan_id)
|
||||
|
||||
if not subscription or not plan:
|
||||
if not subscription :
|
||||
logger.warning(f"Подписки для пользователя {telegram_id} не найдены")
|
||||
raise HTTPException(status_code=404, detail="No subscriptions found")
|
||||
|
||||
plan = await database_manager.get_plan_by_id(subscription.plan_id)
|
||||
|
||||
if not plan:
|
||||
logger.warning(f"Тариф для пользователя {telegram_id} не найдены")
|
||||
raise HTTPException(status_code=404, detail="No plan found")
|
||||
|
||||
return {
|
||||
"id": str(subscription.id),
|
||||
"user_id": subscription.user_id,
|
||||
|
||||
Reference in New Issue
Block a user