From 55de51872a7cdd43e1107ca4690674cd749adb11 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 22 Oct 2026 17:48:13 +0800 Subject: [PATCH] refactor: resolve column name ambiguity in outer subquery by filtering is_active on default_query_set --- apps/tools/serializers/tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/tools/serializers/tool.py b/apps/tools/serializers/tool.py index 946f70be341..bf4250f0c60 100644 --- a/apps/tools/serializers/tool.py +++ b/apps/tools/serializers/tool.py @@ -1795,7 +1795,8 @@ def get_query_set(self, workspace_manage, is_x_pack_ee): is_active = self.data.get("is_active") if is_active is not None: - tool_query_set = tool_query_set.filter(is_active=is_active) + # 作用于外层子查询 temp,避免与 join 的 user.is_active 产生列名歧义 + default_query_set = default_query_set.filter(is_active=is_active) tool_type_list = self.data.get("tool_type_list") if tool_type_list: