0.12.35 fix webpush
This commit is contained in:
20
BaseModels/pay_systems/DVL_Group_kaz/api/funcs.py
Normal file
20
BaseModels/pay_systems/DVL_Group_kaz/api/funcs.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import requests
|
||||
|
||||
def ping():
|
||||
|
||||
req_str = f'https://developerhub.alfabank.by:8273/partner/1.0.1/public/nationalRates{code_str}{date_str}'
|
||||
data = {}
|
||||
headers = {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
|
||||
try:
|
||||
msg = f'GET {req_str}'
|
||||
print(msg)
|
||||
res = requests.get(req_str, data=data, headers=headers)
|
||||
msg = f'answer received = {str(res)}'
|
||||
print(msg)
|
||||
except Exception as e:
|
||||
msg = f'Exception GET {req_str} = {str(e)} ({str(res)})'
|
||||
print(msg)
|
||||
res = None
|
||||
@@ -126,12 +126,23 @@ def search_matches(for_routes=None):
|
||||
if found_routes:
|
||||
msg = f'found routes for send messages = {found_routes.count()}'
|
||||
|
||||
data_Dict = get_Dict_for_send_msgs(params, found_routes[0].owner_type)
|
||||
msg = send_push_message_for_found_matches_routes(route, data_Dict)
|
||||
if msg:
|
||||
try:
|
||||
data_Dict = get_Dict_for_send_msgs(params, found_routes[0].owner_type)
|
||||
msg = send_push_message_for_found_matches_routes(route, data_Dict)
|
||||
if msg:
|
||||
log += msg
|
||||
except Exception as e:
|
||||
msg = f'<br>\n! search_matches Error send_push_message_for_found_matches_routes = {str(e)}'
|
||||
print(msg)
|
||||
log += msg
|
||||
msg = send_mail_found_matches_routes(route, data_Dict)
|
||||
if msg:
|
||||
|
||||
try:
|
||||
msg = send_mail_found_matches_routes(route, data_Dict)
|
||||
if msg:
|
||||
log += msg
|
||||
except Exception as e:
|
||||
msg = f'<br>\n! search_matches Error send_mail_found_matches_routes = {str(e)}'
|
||||
print(msg)
|
||||
log += msg
|
||||
|
||||
except Exception as e:
|
||||
|
||||
@@ -29,10 +29,12 @@ DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
|
||||
|
||||
# https://web-push-codelab.glitch.me/
|
||||
WEBPUSH_SETTINGS = {
|
||||
"VAPID_PUBLIC_KEY": "BKS8byh3MucwCF2h06JY9oey1s1RYII09j-j3ehI3qTYhs965UHv0qNPl-jFjQBbIJCvjVXm9RW6t_oJJK8yMOk",
|
||||
"VAPID_PRIVATE_KEY": "f5NMgOntBtRqsyeKwEzloK-051ggMnZGF_GFimERY0w",
|
||||
# "VAPID_PUBLIC_KEY": "BKS8byh3MucwCF2h06JY9oey1s1RYII09j-j3ehI3qTYhs965UHv0qNPl-jFjQBbIJCvjVXm9RW6t_oJJK8yMOk",
|
||||
# "VAPID_PRIVATE_KEY": "f5NMgOntBtRqsyeKwEzloK-051ggMnZGF_GFimERY0w",
|
||||
"VAPID_PUBLIC_KEY": "BNf5y-99x5UNoaK98VAPKzZOevJHnak-LUmiQFu_r0i8tO3z7TPsto0DKHzNUO76ejNVWjmpL3UoavIsa3C3NEs",
|
||||
"VAPID_PRIVATE_KEY": "4m8Z-bmT7ofb4bxM488eqFUksqnBUGzZh2rBrfSvPGo",
|
||||
"VAPID_ADMIN_EMAIL": "admin@tripwb.com"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user