Fix activation date reference and update localization for promo code toggle success message
- Changed the reference from `created_at` to `activated_at` in the promo activations handler to accurately reflect the activation date. - Updated the localization files for both English and Russian to remove HTML tags from the promo code toggle success message, enhancing clarity.
This commit is contained in:
@@ -1095,7 +1095,7 @@ async def promo_activations_handler(callback: types.CallbackQuery, i18n_data: di
|
||||
)]
|
||||
|
||||
for activation in activations:
|
||||
activation_date = activation.created_at.strftime('%Y-%m-%d %H:%M') if activation.created_at else "N/A"
|
||||
activation_date = activation.activated_at.strftime('%Y-%m-%d %H:%M') if activation.activated_at else "N/A"
|
||||
text_parts.append(_(
|
||||
"admin_promo_activation_item",
|
||||
default="👤 User ID: <b>{user_id}</b>\n📅 Дата: <b>{date}</b>\n",
|
||||
|
||||
@@ -77,7 +77,7 @@ async def get_promo_activations_by_code_id(session: AsyncSession, promo_code_id:
|
||||
from db.models import PromoCodeActivation
|
||||
stmt = (select(PromoCodeActivation)
|
||||
.where(PromoCodeActivation.promo_code_id == promo_code_id)
|
||||
.order_by(PromoCodeActivation.created_at.desc())
|
||||
.order_by(PromoCodeActivation.activated_at.desc())
|
||||
.limit(50)) # Limit to last 50 activations
|
||||
result = await session.execute(stmt)
|
||||
return result.scalars().all()
|
||||
|
||||
+1
-1
@@ -420,7 +420,7 @@
|
||||
"admin_promo_toggle_status_button": "🔄 On/Off",
|
||||
"admin_promo_view_activations_button": "📋 Activations",
|
||||
"admin_promo_back_to_list_button": "⬅️ Back to list",
|
||||
"admin_promo_toggle_success": "✅ Promo code <b>{code}</b> {status}",
|
||||
"admin_promo_toggle_success": "✅ Promo code {code} {status}",
|
||||
"admin_promo_toggle_failed": "❌ Error changing promo code status",
|
||||
"admin_promo_no_activations": "📋 <b>Activations of promo code: {code}</b>\n\n❌ No activations found",
|
||||
"admin_promo_activations_header": "📋 <b>Activations of promo code: {code}</b>\n\n",
|
||||
|
||||
+1
-1
@@ -419,7 +419,7 @@
|
||||
"admin_promo_toggle_status_button": "🔄 Вкл/Выкл",
|
||||
"admin_promo_view_activations_button": "📋 Активации",
|
||||
"admin_promo_back_to_list_button": "⬅️ К списку",
|
||||
"admin_promo_toggle_success": "✅ Промокод <b>{code}</b> {status}",
|
||||
"admin_promo_toggle_success": "✅ Промокод {code} {status}",
|
||||
"admin_promo_toggle_failed": "❌ Ошибка изменения статуса промокода",
|
||||
"admin_promo_no_activations": "📋 <b>Активации промокода: {code}</b>\n\n❌ Активаций не найдено",
|
||||
"admin_promo_activations_header": "📋 <b>Активации промокода: {code}</b>\n\n",
|
||||
|
||||
Reference in New Issue
Block a user