From 1b5245bbd7d8390e70e5ff051ba47f0f47d9d7b4 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Sat, 1 Mar 2025 21:47:16 +0000 Subject: [PATCH] mplink: Always use redirect --- api/products/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/products/views.py b/api/products/views.py index fd2ecaa..7ddb2dd 100644 --- a/api/products/views.py +++ b/api/products/views.py @@ -1249,7 +1249,9 @@ def mini_prog_entry_redirect(code, tid): # the mplink path setting may not work for some reason, so we use # redirect param of the index page as a fallback query += '&redirect=' + path - url = cache.get_or_set(key, lambda: mplink(query, path, env_version), 300) + # passing path other than /pages/index/index to mplink may get an error, use + # the redirect param of the index page as a fallback for now + url = cache.get_or_set(key, lambda: mplink(query, "/pages/index/index", env_version), 300) return redirect(url) class MiniProgEntryView(BaseView):