измененение статического пути

main
pilot 2 months ago
parent f4ac14af02
commit 03932ca334

@ -3,6 +3,7 @@ import json
import requests
from max_bot.models import Client
from restoran_max_bot.common import common_get_menu, common_get_data
from restoran_max_bot.settings import DEBUG
def maxbot_send_text_message(chat_id: str, max_token: str, message: str):
@ -67,6 +68,7 @@ def maxbot_send_menu_button(client: Client, chat_id: str, max_token: str, messag
cnt = cnt + 1
buttons.append(button)
if DEBUG:
print(buttons)
payload = json.dumps({
"text": message,

@ -10,6 +10,7 @@ from restoran_max_bot.bot_started import bot_started
from restoran_max_bot.bot_stopped import bot_stopped
from restoran_max_bot.bot_message import bot_message
from restoran_max_bot.common import common_get_contact
from restoran_max_bot.settings import DEBUG
from restoran_max_bot.utils import is_json, has_key
@ -66,6 +67,7 @@ def api_start_max_v1(request, token, **kwargs):
client = kwargs['client']
settings_max = kwargs['settings_max']
if DEBUG:
print(data)
if not has_key(data, 'update_type'):
@ -117,7 +119,6 @@ def iiko_webhook(request: WSGIRequest, token):
@csrf_exempt
def iiko_send_message(request: WSGIRequest, token):
rt = {'success': False, 'data': ''}
# print(request.body)
if request.method == "POST":
data = json.loads(request.body)
client = Client.objects.filter(token=token).first()

@ -5,6 +5,7 @@ from restoran_max_bot.bot_started import check_registration
from restoran_max_bot.common import *
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.settings import STATICFILES_DIRS
from restoran_max_bot.utils import has_key
@ -100,7 +101,7 @@ def bot_message(client: Client, message: dict, settings: dict, message_type):
for dt in data:
if dt.title == '##bonus##':
img = qrcode.make(contact.phone)
img.save(f"./restoran_max_bot/static/client_qr/{contact.phone}.png")
img.save(f"{STATICFILES_DIRS[0]}/client_qr/{contact.phone}.png")
url = f"https://maxbot.telefon-ip.ru/static/client_qr/{contact.phone}.png"
maxbot_send_img_message(chat_id=chat_id, max_token=settings['token'], img=url,
message='QR-код для начисления, списания бонусов.')

@ -55,7 +55,6 @@ def customer_create(api_key, phone, name, organization_id, birthday: str):
'Authorization': 'Bearer ' + access_token(api_key)
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
if response.status_code == 200:
data = response.json()
else:

Loading…
Cancel
Save