mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-02-23 04:40:59 +00:00
fix: add refresh before assigning promo_groups to avoid async lazy load error
This commit is contained in:
@@ -233,6 +233,8 @@ async def create_tariff(
|
||||
if promo_group_ids:
|
||||
promo_groups_result = await db.execute(select(PromoGroup).where(PromoGroup.id.in_(promo_group_ids)))
|
||||
promo_groups = promo_groups_result.scalars().all()
|
||||
# Refresh чтобы избежать lazy load в async контексте
|
||||
await db.refresh(tariff, ['allowed_promo_groups'])
|
||||
tariff.allowed_promo_groups = list(promo_groups)
|
||||
|
||||
await db.commit()
|
||||
|
||||
Reference in New Issue
Block a user