From 0ff1413780b68b219c0a7e9b0c7a85216d315f6a Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Fri, 3 Jan 2025 11:37:24 +0800 Subject: [PATCH] perf: ticket info add org name --- apps/tickets/models/ticket/general.py | 3 +++ apps/tickets/notifications.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/tickets/models/ticket/general.py b/apps/tickets/models/ticket/general.py index 334e14f13..1696c94eb 100644 --- a/apps/tickets/models/ticket/general.py +++ b/apps/tickets/models/ticket/general.py @@ -423,6 +423,9 @@ class Ticket(StatusMixin, JMSBaseModel): new_value = alias if alias else account new_values.append(str(new_value)) value = ', '.join(new_values) + elif name == 'org_id': + org = Organization.get_instance(value) + value = org.name if org else '' elif isinstance(value, list): value = ', '.join(value) return value diff --git a/apps/tickets/notifications.py b/apps/tickets/notifications.py index e217acf80..23e1c4e4b 100644 --- a/apps/tickets/notifications.py +++ b/apps/tickets/notifications.py @@ -83,7 +83,7 @@ class BaseTicketMessage(UserMessage): @property def basic_items(self): - item_names = ['serial_num', 'title', 'type', 'state', 'applicant', 'comment'] + item_names = ['serial_num', 'title', 'type', 'state', 'org_id', 'applicant', 'comment'] return self._get_fields_items(item_names) @property