From 3e090eb701cbcfd85777b45cfcec860d0bbf0950 Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 25 Dec 2023 19:19:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E5=BA=94=E7=94=A8=E6=97=B6=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/models/applet/applet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/terminal/models/applet/applet.py b/apps/terminal/models/applet/applet.py index fd5934285..9e501eb50 100644 --- a/apps/terminal/models/applet/applet.py +++ b/apps/terminal/models/applet/applet.py @@ -172,8 +172,9 @@ class Applet(JMSBaseModel): return None spec_label = asset.labels.filter(label__name__in=['AppletHost', '发布机']).first() - if spec_label: - matched = [host for host in hosts if host.name == spec_label.value] + if spec_label and spec_label.label: + label_value = spec_label.label.value + matched = [host for host in hosts if host.name == label_value] if matched: return matched[0]