From 89d116acfd7fc0eeb93f54578c42f0f965253a11 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 29 Jun 2026 13:22:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20discountid=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=AE=80=E5=8C=96=E4=B8=BA=E5=8D=95=E4=B8=80=E8=B7=AF=E5=BE=84?= =?UTF-8?q?request.=5Frun=5Fenv.param=5Fkw?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- discount/init.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/discount/init.py b/discount/init.py index 49001e5..b0d66fd 100644 --- a/discount/init.py +++ b/discount/init.py @@ -739,14 +739,7 @@ async def get_discount_setting_products(request): Used in Jinja2 template: {% set products = get_discount_setting_products(request) %} """ env = request._run_ns - # Try multiple ways to get discountid from URL query params - discountid = '' - if hasattr(request, '_run_env') and hasattr(request._run_env, 'param_kw'): - discountid = (request._run_env.param_kw or {}).get('discountid', '') - if not discountid and hasattr(request, 'rel_url') and request.rel_url: - discountid = request.rel_url.query.get('discountid', '') - if not discountid and hasattr(request, 'query'): - discountid = request.query.get('discountid', '') + discountid = (request._run_env.param_kw or {}).get('discountid', '') user_orgid = await env.get_userorgid() if not discountid or not user_orgid: