Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#1199 from hanshuaikang/feature/dev…
Browse files Browse the repository at this point in the history
…elop_by_han

bugfix: 修复部分条件下无value的情况,此时优先取label
  • Loading branch information
hanshuaikang authored Sep 12, 2023
2 parents e3803dc + 38713c2 commit dbd49ed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions itsm/ticket/models/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dbd49ed

Please sign in to comment.