From 72997068c68065f9c957fbff215c70f49da05c8c Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 4 Mar 2026 01:24:14 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20orders=20defpage=20endpoint=20references?= =?UTF-8?q?=20=E2=80=94=20app-level=20not=20blueprint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit defpages mounted via auto_mount_pages() register endpoints without blueprint prefix. Fix url_for("orders.defpage_*") → url_for("defpage_*"). Co-Authored-By: Claude Opus 4.6 --- orders/bp/order/routes.py | 6 +++--- orders/bp/orders/routes.py | 2 +- orders/sxc/pages/__init__.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/orders/bp/order/routes.py b/orders/bp/order/routes.py index 155078d..5344fb5 100644 --- a/orders/bp/order/routes.py +++ b/orders/bp/order/routes.py @@ -42,7 +42,7 @@ def register() -> Blueprint: return await make_response("Order not found", 404) if order.status == "paid": - return redirect(url_for("orders.defpage_order_detail", order_id=order.id)) + return redirect(url_for("defpage_order_detail", order_id=order.id)) if order.sumup_hosted_url: return redirect(order.sumup_hosted_url) @@ -102,13 +102,13 @@ def register() -> Blueprint: return await make_response("Order not found", 404) if not order.sumup_checkout_id: - return redirect(url_for("orders.defpage_order_detail", order_id=order.id)) + return redirect(url_for("defpage_order_detail", order_id=order.id)) try: await check_sumup_status(g.s, order) except Exception: pass - return redirect(url_for("orders.defpage_order_detail", order_id=order.id)) + return redirect(url_for("defpage_order_detail", order_id=order.id)) return bp diff --git a/orders/bp/orders/routes.py b/orders/bp/orders/routes.py index 845d1a5..3aa6b6b 100644 --- a/orders/bp/orders/routes.py +++ b/orders/bp/orders/routes.py @@ -88,7 +88,7 @@ def register(url_prefix: str) -> Blueprint: "total_formatted": f"{o.total_amount or 0:.2f}", }) - detail_prefix = pfx + url_for("orders.defpage_order_detail", order_id=0).rsplit("0/", 1)[0] + detail_prefix = pfx + url_for("defpage_order_detail", order_id=0).rsplit("0/", 1)[0] qs_fn = makeqs_factory() rows_url = pfx + url_for("orders.orders_rows") diff --git a/orders/sxc/pages/__init__.py b/orders/sxc/pages/__init__.py index ebbc2c7..4250a62 100644 --- a/orders/sxc/pages/__init__.py +++ b/orders/sxc/pages/__init__.py @@ -308,7 +308,7 @@ async def _h_orders_list_content(**kw): from shared.utils import route_prefix rpfx = route_prefix() - detail_prefix = rpfx + url_for_fn("orders.defpage_order_detail", order_id=0).rsplit("0/", 1)[0] + detail_prefix = rpfx + url_for_fn("defpage_order_detail", order_id=0).rsplit("0/", 1)[0] rows_url = rpfx + url_for_fn("orders.orders_rows") return await render_to_sx("orders-list-content",