From a06c7312395ac35f95552573c90dee438fcd06b5 Mon Sep 17 00:00:00 2001 From: benero Date: Wed, 6 Nov 2024 10:04:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8F=90=E5=8D=95?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E5=AD=98=E5=9C=A8=20json=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98=20--bug?= =?UTF-8?q?=3D133449073?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/RELEASE.md | 7 ++++--- docs/RELEASE_EN.md | 7 ++++--- itsm/ticket/models/ticket.py | 10 +++++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 3911ede6..be9be8b0 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -1,9 +1,10 @@ # Changelog -## [Version: 2.7.1] - 2024-10-15 +## [Version: 2.7.1] - 2024-11-06 【新增】pipeline管理工具集成 【优化】多行文本兼容 JSON、Markdown 格式 -【修复】修复可输入单选组件在触发器无法选择条件的问题 -【修复】修复节点新增字段无法检测上一节点的字段值的问题 +【修复】修复可输入单选组件在触发器无法选择条件的问题 +【修复】修复节点新增字段无法检测上一个节点的字段值的问题 +【修复】修复提单节点存在 json 组件异常的问题 ## [Version: 2.7.0] - 2024-10-10 diff --git a/docs/RELEASE_EN.md b/docs/RELEASE_EN.md index 7b2f550b..c3e7d449 100644 --- a/docs/RELEASE_EN.md +++ b/docs/RELEASE_EN.md @@ -1,16 +1,17 @@ # Changelog -## [Version: 2.7.1] - 2024-10-15 +## [Version: 2.7.1] - 2024-11-06 【Feature】Integrated pipeline management tool. -【Improved】Ensure TEXT compatibility with JSON and Markdown formats. +【Improved】Ensure TEXT compatibility with JSON and Markdown formats. 【Fix】Resolve the issue where the inputselect component cannot select conditions in the trigger. 【Fix】Fix the issue where newly added fields in a node cannot detect from the previous node. +【Fix】Fix the issue with the JSON component anomaly in the submission node. ## [Version: 2.7.0] - 2024-10-10 【Feature】Notification recipient blacklist filtering. 【Improved】Migrated the authentication information to header when calling esb, support open-paas/esb >= 2.12.20 【Improved】Changed “My Tasks” to “My Completed” in the navigation bar. -【Improved】Adjust default items when adding an Approval Node in the process. +【Improved】Adjust default items when adding an Approval Node in the process. 【Improved】Adjusted platform management permissions to be instance-free authentication. 【Fixed】The navigation bar style has been standardized according to the design specifications. 【Fixed】Modified the implementation method for exporting common API files. diff --git a/itsm/ticket/models/ticket.py b/itsm/ticket/models/ticket.py index bc42e664..8704307b 100644 --- a/itsm/ticket/models/ticket.py +++ b/itsm/ticket/models/ticket.py @@ -29,6 +29,7 @@ import time from datetime import datetime from itertools import chain +from json import JSONDecodeError import requests import jsonfield @@ -3086,7 +3087,14 @@ def fill_state_fields(self, fields): for ticket_field in filter_field_query_set: ticket_field.value = fields_map[ticket_field.key]["value"] if isinstance(ticket_field.value, str) and ticket_field.type not in FIELD_IGNORE_ESCAPE: - ticket_field.value = texteditor_escape(ticket_field.value) + need_escape = True + try: + json.loads(ticket_field.value) + need_escape = False + except JSONDecodeError: + pass + if need_escape: + ticket_field.value = texteditor_escape(ticket_field.value) ticket_field.choice = fields_map[ticket_field.key].get("choice", []) language_config = (