Add files via upload

This commit is contained in:
Egor
2026-01-26 19:13:59 +03:00
committed by GitHub
parent b636aec03a
commit 715520320d
2 changed files with 8 additions and 1 deletions
+4
View File
@@ -362,6 +362,10 @@ class HeleketPaymentMixin:
await db.commit()
await db.refresh(user)
# Перезагружаем пользователя с зависимостями после коммита,
# чтобы избежать lazy load в async-контексте (MissingGreenlet)
user = await get_user_by_id(db, user.id) or user
if getattr(self, 'bot', None):
topup_status = '🆕 Первое пополнение' if was_first_topup else '🔄 Пополнение'
referrer_info = format_referrer_info(user)
+4 -1
View File
@@ -472,7 +472,10 @@ class WataPaymentMixin:
user.balance_kopeks += payment.amount_kopeks
user.updated_at = datetime.utcnow()
await db.commit()
await db.refresh(user)
user = await payment_module.get_user_by_id(db, user.id)
if not user:
logger.error('Пользователь %s не найден после коммита WATA', payment.user_id)
return payment
promo_group = user.get_primary_promo_group()
subscription = getattr(user, 'subscription', None)