From 95992a360f70ca26d553e91bacb347447760e8d7 Mon Sep 17 00:00:00 2001 From: guohelu <19503896967@163.com> Date: Tue, 19 Nov 2024 10:39:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E9=97=AE=E9=A2=98=20#7603?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcloud/apigw/views/get_template_list.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcloud/apigw/views/get_template_list.py b/gcloud/apigw/views/get_template_list.py index 648385fc0..6acb17ac8 100644 --- a/gcloud/apigw/views/get_template_list.py +++ b/gcloud/apigw/views/get_template_list.py @@ -53,13 +53,13 @@ def get_template_list(request, project_id): if label_names: try: label_names = label_names.split(",") - label_ids = Label.objects.filter(name__in=label_names).values_list("id", flat=True) - label_template_ids = TemplateLabelRelation.objects.fetch_template_ids_using_labels(label_ids) - label_ids = list(map(str, label_template_ids)) + label_ids = Label.objects.filter(name__in=label_names, project_id=project_id).values_list("id", flat=True) + template_ids = TemplateLabelRelation.objects.fetch_template_ids_using_labels(label_ids) + template_ids = list(map(str, template_ids)) if id_in is None: - id_in = label_ids + id_in = template_ids else: - id_in = list(set(id_in + label_ids)) + id_in = list(set(id_in + template_ids)) except Exception: logger.exception("[API] label_names[{}] resolve fail, ignore.".format(label_names))