1.0.2 subscribe page w dynamically load

This commit is contained in:
SDE
2024-05-07 16:23:40 +03:00
parent cbe5271426
commit 9eb5936690
2 changed files with 7 additions and 3 deletions

View File

@@ -12,8 +12,8 @@ def get_order_status(order):
res_data = get_order_status(order.bank_order_id)
res = json.loads(res_data.text)
order.json_data['status'] = res
res = res['orders'][0]
order.json_data['status'] = res
order.status = res['status']
@@ -69,8 +69,9 @@ def create_subscribe_order(data):
order.pay_page = res_data.headers.get('location')
res = json.loads(res_data.text)
order.json_data['create_order'] = res
res = res['orders'][0]
order.json_data['create_order'] = res
order.modifiedDT = datetime.strptime(res['updated'], '%Y-%m-%d %H:%M:%S')
order.status = res['status']
order.bank_order_id = res['id']

View File

@@ -77,7 +77,10 @@ def get_profile_subscribe_page_content_Dict(request):
order = get_order_status(order)
subscribes_for_user = check_n_enable_subscribe_by_order(order)
if not subscribes_for_user:
subscribes.get(id=order.subscribe.id).order_error = order.status
error = f'{order.status}'
if 'status' in order.json_data and 'failure_message' in order.json_data['status']:
error = f'{error} ({order.json_data["status"]["failure_message"]})'
subscribes.get(id=order.subscribe.id).order_error = error
check_orders_required = False
else:
check_orders_required = True