mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-04-29 09:10:06 +00:00
fix: sync squads to Remnawave panel on tariff purchase/switch
When sync_squads parameter was introduced (4aaf0ddd) to prevent FK
violations from stale squad UUIDs, all update_remnawave_user calls
defaulted to sync_squads=False. This broke squad synchronization for
purchase/tariff-change flows where squads are freshly assigned and
must be sent to the panel.
Adds sync_squads=True to all purchase, tariff switch, and country
selection call sites across cabinet, bot handlers, miniapp, and
auto-purchase service.
This commit is contained in:
@@ -5691,7 +5691,7 @@ async def update_subscription_servers_endpoint(
|
||||
pass
|
||||
|
||||
service = SubscriptionService()
|
||||
await service.update_remnawave_user(db, subscription)
|
||||
await service.update_remnawave_user(db, subscription, sync_squads=True)
|
||||
|
||||
await with_admin_notification_service(
|
||||
lambda service: service.send_subscription_update_notification(
|
||||
@@ -6500,6 +6500,7 @@ async def purchase_tariff_endpoint(
|
||||
subscription,
|
||||
reset_traffic=True,
|
||||
reset_reason='покупка тарифа (miniapp)',
|
||||
sync_squads=True,
|
||||
)
|
||||
|
||||
# Сохраняем корзину для автопродления
|
||||
@@ -6873,6 +6874,7 @@ async def switch_tariff_endpoint(
|
||||
subscription,
|
||||
reset_traffic=should_reset_traffic,
|
||||
reset_reason='смена тарифа',
|
||||
sync_squads=True,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error('Ошибка синхронизации с RemnaWave при смене тарифа', error=e)
|
||||
|
||||
Reference in New Issue
Block a user