From dc7da4441a5f2ceba37a1095618c4bc0e84305d4 Mon Sep 17 00:00:00 2001 From: Zakhar Izmaylov Date: Sun, 24 Nov 2024 22:35:43 +0300 Subject: [PATCH] Remove unused __init__.py file and update payment handler callback buttons to unify navigation. Change "back_to_profile" callback to "pay" in multiple payment processing files for consistency. --- __init__.py | 0 handlers/keys/trial_key.py | 7 +------ handlers/payments/cryprobot_pay.py | 2 +- handlers/payments/freekassa_pay.py | 2 +- handlers/payments/robokassa_pay.py | 2 +- handlers/payments/yookassa_pay.py | 2 +- 6 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 __init__.py diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/handlers/keys/trial_key.py b/handlers/keys/trial_key.py index 13c74362..5350eb52 100644 --- a/handlers/keys/trial_key.py +++ b/handlers/keys/trial_key.py @@ -42,12 +42,7 @@ async def create_trial_key(tg_id: int, session: Any): ) await store_key( - tg_id, - client_id, - email, - expiry_timestamp, - public_link, - server_id=least_loaded_cluster, + tg_id, client_id, email, expiry_timestamp, public_link, server_id=least_loaded_cluster, session=session ) await use_trial(tg_id, session) return result diff --git a/handlers/payments/cryprobot_pay.py b/handlers/payments/cryprobot_pay.py index d25c263d..9a612586 100644 --- a/handlers/payments/cryprobot_pay.py +++ b/handlers/payments/cryprobot_pay.py @@ -54,7 +54,7 @@ async def process_callback_pay_cryptobot(callback_query: types.CallbackQuery, st callback_data="enter_custom_amount_crypto", ) ) - builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="back_to_profile")) + builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="pay")) key_count = await get_key_count(callback_query.message.chat.id) if key_count == 0: exists = await check_connection_exists(callback_query.message.chat.id) diff --git a/handlers/payments/freekassa_pay.py b/handlers/payments/freekassa_pay.py index b3c26790..7c423129 100644 --- a/handlers/payments/freekassa_pay.py +++ b/handlers/payments/freekassa_pay.py @@ -110,7 +110,7 @@ async def process_callback_pay_freekassa(callback_query: types.CallbackQuery, st callback_data="enter_custom_amount_freekassa", ) ) - builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="back_to_profile")) + builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="pay")) await callback_query.message.answer( text="Выберите сумму пополнения через FreeKassa:", diff --git a/handlers/payments/robokassa_pay.py b/handlers/payments/robokassa_pay.py index f9248aec..f2e50906 100644 --- a/handlers/payments/robokassa_pay.py +++ b/handlers/payments/robokassa_pay.py @@ -79,7 +79,7 @@ async def process_callback_pay_robokassa(callback_query: types.CallbackQuery, st callback_data="enter_custom_amount_robokassa", ) ) - builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="back_to_profile")) + builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="pay")) key_count = await get_key_count(tg_id) diff --git a/handlers/payments/yookassa_pay.py b/handlers/payments/yookassa_pay.py index edc9f071..7d073a55 100644 --- a/handlers/payments/yookassa_pay.py +++ b/handlers/payments/yookassa_pay.py @@ -61,7 +61,7 @@ async def process_callback_pay_yookassa(callback_query: types.CallbackQuery, sta callback_data="enter_custom_amount_yookassa", ) ) - builder.row(InlineKeyboardButton(text="👤 Личный кабинет", callback_data="profile")) + builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="pay")) key_count = await get_key_count(tg_id)