Skip to content

Commit

Permalink
bugfix: 修复部分条件下无value的情况,此时优先取label
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshuaikang committed Sep 12, 2023
1 parent 9479097 commit 38713c2
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 38713c2

Please sign in to comment.