From 005e85483e2bbe9427213ef2f376a9aeb0895ad6 Mon Sep 17 00:00:00 2001 From: pilot <657434@03b.ru> Date: Mon, 10 Aug 2026 15:16:11 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D1=91=D0=BD:=20restoran=5Fmax=5Fbot/settings.py=20?= =?UTF-8?q?=E2=80=94=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B8?= =?UTF-8?q?=20MEDIA=5FROOT=20=D0=B8=20MEDIA=5FURL=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B4=D0=B8=D0=BD=D0=B0=D0=BC=D0=B8=D1=87=D0=B5=D1=81=D0=BA?= =?UTF-8?q?=D0=B8=D1=85=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2.=20?= =?UTF-8?q?=E2=9C=85=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D1=91=D0=BD:?= =?UTF-8?q?=20restoran=5Fmax=5Fbot/promo=5Fhandlers.py=20=E2=80=94=20?= =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=BE=20=D1=81=D0=BE?= =?UTF-8?q?=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20QR-=D0=BA?= =?UTF-8?q?=D0=BE=D0=B4=D0=BE=D0=B2=20=D0=B2=20MEDIA=5FROOT=20=D0=B8=20?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D1=81=D1=8B=D0=BB=D0=BE=D0=BA=20=D1=87?= =?UTF-8?q?=D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D0=BE=D0=B2=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20Django=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20DEBUG=3DTrue.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../restoran_max_bot/command_handlers.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/restoran_max_bot/restoran_max_bot/command_handlers.py b/restoran_max_bot/restoran_max_bot/command_handlers.py index cd95a71..909828e 100644 --- a/restoran_max_bot/restoran_max_bot/command_handlers.py +++ b/restoran_max_bot/restoran_max_bot/command_handlers.py @@ -7,7 +7,7 @@ from restoran_max_bot.common import common_get_data, common_get_integration from restoran_max_bot.iiko_api import customer_info, customer_create, customer_wallet from restoran_max_bot.rkiper_api import rkiper_customer_info, rkiper_customer_create from restoran_max_bot.message_sender import send_text, send_image, send_menu, send_feedback_buttons, send_booking_people_buttons, send_link_button -from restoran_max_bot.settings import BASE_URL, MEDIA_ROOT, MEDIA_URL +from restoran_max_bot.settings import BASE_URL, MEDIA_ROOT, MEDIA_URL, STATICFILES_DIRS from restoran_max_bot.utils import is_json from restoran_max_bot.bot_started import check_registration from restoran_max_bot.promo_handlers import bot_promo @@ -110,10 +110,12 @@ def _handle_bonus(client: Client, chat_id: str, token: str, contact: Contact) -> # Генерируем QR-код img = qrcode.make(contact.phone) file_name = f"{contact.phone}.png" - client_qr_dir = os.path.join(MEDIA_ROOT, 'client_qr') - os.makedirs(client_qr_dir, exist_ok=True) - img.save(os.path.join(client_qr_dir, file_name)) - qr_url = f"{BASE_URL}{MEDIA_URL}client_qr/{file_name}" + # Сохраняем в статическую папку (как было изначально) + img.save(f"{STATICFILES_DIRS[0]}/client_qr/{file_name}") + # Формируем URL (жёстко, как работало раньше) + qr_url = f"https://maxbot.telefon-ip.ru/static/client_qr/{file_name}" + # Логируем для отладки + print(f"DEBUG BONUS QR URL: {qr_url}") send_image(chat_id, token, qr_url, 'QR-код для начисления, списания бонусов.') # Получаем баланс