mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-02-06 12:10:25 +00:00
@@ -2673,7 +2673,8 @@ async def _extend_existing_subscription(
|
||||
current_subscription.device_limit = device_limit
|
||||
# Если указан squad_uuid, добавляем его к существующим серверам
|
||||
if squad_uuid and squad_uuid not in current_subscription.connected_squads:
|
||||
current_subscription.connected_squads.append(squad_uuid)
|
||||
# Используем += для безопасного добавления в список SQLAlchemy
|
||||
current_subscription.connected_squads = current_subscription.connected_squads + [squad_uuid]
|
||||
else:
|
||||
# Для обычной подписки просто продлеваем
|
||||
# Обновляем трафик и устройства, если нужно
|
||||
@@ -2683,7 +2684,8 @@ async def _extend_existing_subscription(
|
||||
current_subscription.device_limit = device_limit
|
||||
# Если указан squad_uuid и его ещё нет в подписке, добавляем
|
||||
if squad_uuid and squad_uuid not in current_subscription.connected_squads:
|
||||
current_subscription.connected_squads.append(squad_uuid)
|
||||
# Используем += для безопасного добавления в список SQLAlchemy
|
||||
current_subscription.connected_squads = current_subscription.connected_squads + [squad_uuid]
|
||||
|
||||
# Продлеваем подписку
|
||||
if current_subscription.end_date > current_time:
|
||||
|
||||
@@ -329,7 +329,7 @@ def get_main_menu_keyboard(
|
||||
and getattr(current_subscription, "is_active", False)
|
||||
)
|
||||
simple_purchase_button = None
|
||||
if settings.SIMPLE_SUBSCRIPTION_ENABLED and not has_active_paid_subscription:
|
||||
if settings.SIMPLE_SUBSCRIPTION_ENABLED:
|
||||
simple_purchase_button = InlineKeyboardButton(
|
||||
text=texts.MENU_SIMPLE_SUBSCRIPTION,
|
||||
callback_data="simple_subscription_purchase",
|
||||
@@ -346,9 +346,6 @@ def get_main_menu_keyboard(
|
||||
subscription_buttons.append(
|
||||
InlineKeyboardButton(text=texts.MENU_BUY_SUBSCRIPTION, callback_data="menu_buy")
|
||||
)
|
||||
if simple_purchase_button:
|
||||
subscription_buttons.append(simple_purchase_button)
|
||||
simple_purchase_button = None
|
||||
|
||||
if subscription_buttons:
|
||||
paired_buttons.extend(subscription_buttons)
|
||||
|
||||
Reference in New Issue
Block a user