refactoring: polished some files, .env.example update
This commit is contained in:
@@ -11,6 +11,7 @@ from bot.texts import (
|
||||
FAQ_TEXT,
|
||||
GENERAL_PROCESSING,
|
||||
GENERAL_SUCCESS,
|
||||
NO_SUBSCRIPTION,
|
||||
NOTHING_PLACEHOLDER,
|
||||
)
|
||||
from db.models.users import User
|
||||
@@ -122,11 +123,15 @@ async def sub_info(
|
||||
)
|
||||
sub = await deps.subscriptions_repository.get_subscription_by_user_id(session, cb.from_user.id)
|
||||
|
||||
if not user:
|
||||
await cb.answer(CALLBACK_FALLBACK)
|
||||
if not rw_user:
|
||||
await cb.message.edit_text(NO_SUBSCRIPTION, reply_markup=return_to_menu)
|
||||
return
|
||||
|
||||
if not sub:
|
||||
if not user:
|
||||
await cb.answer("1" + CALLBACK_FALLBACK)
|
||||
return
|
||||
|
||||
if rw_user and not sub:
|
||||
try:
|
||||
dto = SubscriptionPlan(
|
||||
devices=rw_user.hwid_device_limit,
|
||||
@@ -143,7 +148,7 @@ async def sub_info(
|
||||
plan_price_paid=utils.calculate_price(dto),
|
||||
)
|
||||
except Exception:
|
||||
await cb.answer(CALLBACK_FALLBACK)
|
||||
await cb.answer("2" + CALLBACK_FALLBACK)
|
||||
return
|
||||
|
||||
await cb.message.edit_text(
|
||||
|
||||
Reference in New Issue
Block a user