From 38713c270bceb057508f6fbf32464c23b5d8175a Mon Sep 17 00:00:00 2001 From: hanshuaikang <1758504262@qq.com> Date: Tue, 12 Sep 2023 16:36:54 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=B8=8B=E6=97=A0value=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=EF=BC=8C=E6=AD=A4=E6=97=B6=E4=BC=98=E5=85=88=E5=8F=96?= =?UTF-8?q?label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- itsm/ticket/models/ticket.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/itsm/ticket/models/ticket.py b/itsm/ticket/models/ticket.py index d4d2b5dd..7e38d71c 100644 --- a/itsm/ticket/models/ticket.py +++ b/itsm/ticket/models/ticket.py @@ -4053,11 +4053,14 @@ def display_content(field_type, content): single = [] for attr_name, attr_value in attr.items(): try: - if isinstance(attr_value["value"], str): + attr_display = ( + attr_value.get("label") or attr_value["value"] + ) + if isinstance(attr_display, str): single.append( "{}:{}".format( schemes_map[scheme][attr_name], - attr_value.get("label") or attr_value["value"], + attr_display, ) ) except Exception as err: