1.0.4 subscribe page w dynamically load

This commit is contained in:
SDE
2024-05-07 18:51:17 +03:00
parent 69c037b30d
commit 3a911d928f
3 changed files with 12 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ class Admin_SubscribeOrder(Admin_BaseModel):
('sum', 'currency'),
('status', 'last_operation_status'),
('bank_order_id', 'pay_page'),
'json_data',
)
}),
)

View File

@@ -28,7 +28,7 @@ def get_subscribes_w_options():
def check_n_enable_subscribe_by_order(order):
subscribes_for_user = SubscribeForUser.objects.filter(user=order.user)
subscribes_for_user = []#SubscribeForUser.objects.filter(user=order.user)
if order and order.enable and order.status == 'charged':
kwargs = {
@@ -80,7 +80,9 @@ def get_profile_subscribe_page_content_Dict(request):
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
for subscribe in subscribes:
if subscribe == order.subscribe:
subscribe.order_error = error
check_orders_required = False
else:
check_orders_required = True

View File

@@ -76,8 +76,14 @@
<div class="text_another_subscribe padding-n-width-another-subscribes ">
{% translate "Период" %}: <span class="orange-text">{{ item.period_name }}</span>
</div>
<button class="read_more_about_subscribe" onclick="send_subscribe({{ item.id }},'{% if page.url == 'for_movers' or page.url == 'for_customers' %}a{% endif %}','{% url "profile_page" "my_subscribe" %}')">{% translate "Перейти" %}</button>
<button class="read_more_about_subscribe" onclick="send_subscribe({{ item.id }},'{% if page.url == 'for_movers' or page.url == 'for_customers' %}a{% endif %}','{% url "profile_page" "my_subscribe" %}')">{% translate "Перейти" %}</button>
</div>
{% if item.order_error %}
<div>
<div>Ошибка оплаты</div>
<div>{{ item.order_error }}</div>
</div>
{% endif %}
{% endif %}