From 1b6b2b2956660d0170bc6b416a567fff34905f5d Mon Sep 17 00:00:00 2001 From: Boris Kovalskii <36034823+JustYay@users.noreply.github.com> Date: Sun, 21 Sep 2025 04:17:06 +0000 Subject: [PATCH] =?UTF-8?q?FIX=20"=D0=9E=D1=82=D0=BE=D0=B1=D0=B6=D1=80?= =?UTF-8?q?=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=20handlers=20?= =?UTF-8?q?=D0=BA=D0=B0=D1=81=D1=81"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handlers/payments/heleket/handlers.py | 7 +++++-- handlers/payments/kassai/handlers.py | 14 ++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/handlers/payments/heleket/handlers.py b/handlers/payments/heleket/handlers.py index f84d3cf0..830e97f8 100644 --- a/handlers/payments/heleket/handlers.py +++ b/handlers/payments/heleket/handlers.py @@ -66,8 +66,11 @@ async def handle_custom_amount_input_heleket( ] ) - language_code = getattr(from_user, "language_code", None) - amount_text = await format_for_user(session, tg_id, float(amount), language_code, force_currency="RUB") + from database.models import User + from sqlalchemy import select + result = await session.execute(select(User.language_code).where(User.tg_id == tg_id)) + language_code = result.scalar_one_or_none() + amount_text = await format_for_user(session, tg_id, float(amount), language_code) text_out = DEFAULT_PAYMENT_MESSAGE.format(amount=amount_text) await edit_or_send_message(target_message=message, text=text_out, reply_markup=markup) diff --git a/handlers/payments/kassai/handlers.py b/handlers/payments/kassai/handlers.py index 717d5885..44e9833f 100644 --- a/handlers/payments/kassai/handlers.py +++ b/handlers/payments/kassai/handlers.py @@ -66,8 +66,11 @@ async def handle_custom_amount_input_kassai_cards( ] ) - language_code = getattr(from_user, "language_code", None) - amount_text = await format_for_user(session, tg_id, float(amount), language_code, force_currency="RUB") + from database.models import User + from sqlalchemy import select + result = await session.execute(select(User.language_code).where(User.tg_id == tg_id)) + language_code = result.scalar_one_or_none() + amount_text = await format_for_user(session, tg_id, float(amount), language_code) text_out = DEFAULT_PAYMENT_MESSAGE.format(amount=amount_text) await edit_or_send_message(target_message=message, text=text_out, reply_markup=markup) @@ -123,8 +126,11 @@ async def handle_custom_amount_input_kassai_sbp( ] ) - language_code = getattr(from_user, "language_code", None) - amount_text = await format_for_user(session, tg_id, float(amount), language_code, force_currency="RUB") + from database.models import User + from sqlalchemy import select + result = await session.execute(select(User.language_code).where(User.tg_id == tg_id)) + language_code = result.scalar_one_or_none() + amount_text = await format_for_user(session, tg_id, float(amount), language_code) text_out = DEFAULT_PAYMENT_MESSAGE.format(amount=amount_text) await edit_or_send_message(target_message=message, text=text_out, reply_markup=markup)