From ceb997da093dd721f95910a66aba0619d8c4651c Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 6 Jul 2026 08:09:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20generate=5Fpromo=5Fqr/discount=5Fqrcode?= =?UTF-8?q?=20=E7=94=A8=20request.=5Frun=5Fns=20=E6=9B=BF=E4=BB=A3=20Serve?= =?UTF-8?q?rEnv()=20=E4=BF=AE=E5=A4=8D=20entire=5Furl=20=E4=B8=BA=20None?= =?UTF-8?q?=20=E7=9A=84500=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- discount/init.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discount/init.py b/discount/init.py index 60c57ce..71e31e3 100644 --- a/discount/init.py +++ b/discount/init.py @@ -18,7 +18,7 @@ async def discount_qrcode(request, params_kw): discount = params_kw.discount valid_term = params_kw.valid_term expired_date = params_kw.expired_date - env = ServerEnv() + env = request._run_ns dbname = env.get_module_dbname('discount') config = getConfig() db = DBPools() @@ -537,7 +537,7 @@ async def disable_promo_code(request, params_kw): async def generate_promo_qr(request, params_kw): """Generate QR code for a promo code.""" - env = ServerEnv() + env = request._run_ns dbname = env.get_module_dbname('discount') promo_id = params_kw.get('id', '')