chore: format balance/main.py and promocode.py

This commit is contained in:
Fringg
2026-03-08 15:41:59 +03:00
parent 7dc5e4ab94
commit 928e3e98f8
2 changed files with 5 additions and 6 deletions
+4 -3
View File
@@ -266,9 +266,10 @@ async def get_quick_amount_buttons(language: str, user: User) -> list:
period_label = f'{period} дней'
# Скидка считается от полной базовой стоимости (период + аддоны без скидок)
total_base = base_price_kopeks + (
devices_price_per_month + sum(servers_per_month_prices) + traffic_price_per_month
) * months
total_base = (
base_price_kopeks
+ (devices_price_per_month + sum(servers_per_month_prices) + traffic_price_per_month) * months
)
has_discount = total_base > total_price and total_base > 0
if has_discount:
+1 -3
View File
@@ -30,9 +30,7 @@ async def show_promocode_menu(callback: types.CallbackQuery, db_user: User, stat
except TelegramBadRequest as error:
error_message = str(error).lower()
if 'there is no text in the message to edit' in error_message:
await callback.message.answer(
texts.PROMOCODE_ENTER, reply_markup=get_back_keyboard(db_user.language)
)
await callback.message.answer(texts.PROMOCODE_ENTER, reply_markup=get_back_keyboard(db_user.language))
else:
raise