chore: format balance/main.py and promocode.py
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user