fix: backup import crash + upload handler hardening
- Fix PaypearPayment → PayPearPayment (capital P) — import crash - Fix AurapayPayment → AuraPayPayment (capital P) — import crash - Update upload instruction message to mention .tar.gz format - Add null guard on document.file_name before extension check
This commit is contained in:
@@ -313,7 +313,7 @@ async def restore_backup_start(callback: types.CallbackQuery, db_user: User, db:
|
|||||||
else:
|
else:
|
||||||
text = """📥 <b>Восстановление из бекапа</b>
|
text = """📥 <b>Восстановление из бекапа</b>
|
||||||
|
|
||||||
📎 Отправьте файл бекапа (.json или .json.gz)
|
📎 Отправьте файл бекапа (.json, .json.gz или .tar.gz)
|
||||||
|
|
||||||
⚠️ <b>ВАЖНО:</b>
|
⚠️ <b>ВАЖНО:</b>
|
||||||
• Файл должен быть создан этой системой бекапов
|
• Файл должен быть создан этой системой бекапов
|
||||||
@@ -393,7 +393,7 @@ async def handle_backup_file_upload(message: types.Message, db_user: User, db: A
|
|||||||
document = message.document
|
document = message.document
|
||||||
allowed_extensions = ('.json', '.json.gz', '.tar.gz', '.tar')
|
allowed_extensions = ('.json', '.json.gz', '.tar.gz', '.tar')
|
||||||
|
|
||||||
if not any(document.file_name.endswith(ext) for ext in allowed_extensions):
|
if not document.file_name or not any(document.file_name.endswith(ext) for ext in allowed_extensions):
|
||||||
await message.answer(
|
await message.answer(
|
||||||
'❌ Неподдерживаемый формат файла. Загрузите .json, .json.gz или .tar.gz файл',
|
'❌ Неподдерживаемый формат файла. Загрузите .json, .json.gz или .tar.gz файл',
|
||||||
reply_markup=InlineKeyboardMarkup(
|
reply_markup=InlineKeyboardMarkup(
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ from app.database.models import (
|
|||||||
AdminRole,
|
AdminRole,
|
||||||
AdvertisingCampaign,
|
AdvertisingCampaign,
|
||||||
AdvertisingCampaignRegistration,
|
AdvertisingCampaignRegistration,
|
||||||
AurapayPayment,
|
AuraPayPayment,
|
||||||
BroadcastHistory,
|
BroadcastHistory,
|
||||||
ButtonClickLog,
|
ButtonClickLog,
|
||||||
CabinetRefreshToken,
|
CabinetRefreshToken,
|
||||||
@@ -61,7 +61,7 @@ from app.database.models import (
|
|||||||
Pal24Payment,
|
Pal24Payment,
|
||||||
PartnerApplication,
|
PartnerApplication,
|
||||||
PaymentMethodConfig,
|
PaymentMethodConfig,
|
||||||
PaypearPayment,
|
PayPearPayment,
|
||||||
PinnedMessage,
|
PinnedMessage,
|
||||||
PlategaPayment,
|
PlategaPayment,
|
||||||
Poll,
|
Poll,
|
||||||
@@ -200,10 +200,10 @@ class BackupService:
|
|||||||
KassaAiPayment,
|
KassaAiPayment,
|
||||||
RioPayPayment,
|
RioPayPayment,
|
||||||
SeverPayPayment,
|
SeverPayPayment,
|
||||||
PaypearPayment,
|
PayPearPayment,
|
||||||
RollyPayPayment,
|
RollyPayPayment,
|
||||||
OverpayPayment,
|
OverpayPayment,
|
||||||
AurapayPayment,
|
AuraPayPayment,
|
||||||
SavedPaymentMethod,
|
SavedPaymentMethod,
|
||||||
# --- Settings/content ---
|
# --- Settings/content ---
|
||||||
PaymentMethodConfig,
|
PaymentMethodConfig,
|
||||||
|
|||||||
Reference in New Issue
Block a user