From e8653c74cde782cf4adfd76ab074d7f354ca77e1 Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Thu, 17 Mar 2022 11:57:25 +0800 Subject: [PATCH] fix: ticket URL type --- apps/tickets/const.py | 2 +- apps/tickets/notifications.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/tickets/const.py b/apps/tickets/const.py index 1d76ae487..9bfaf795e 100644 --- a/apps/tickets/const.py +++ b/apps/tickets/const.py @@ -1,7 +1,7 @@ from django.db.models import TextChoices, IntegerChoices from django.utils.translation import ugettext_lazy as _ -TICKET_DETAIL_URL = '/ui/#/tickets/tickets/{id}' +TICKET_DETAIL_URL = '/ui/#/tickets/tickets/{id}?type={type}' class TicketType(TextChoices): diff --git a/apps/tickets/notifications.py b/apps/tickets/notifications.py index a70e6d497..ffca227be 100644 --- a/apps/tickets/notifications.py +++ b/apps/tickets/notifications.py @@ -20,7 +20,13 @@ class BaseTicketMessage(UserMessage): @property def ticket_detail_url(self): tp = self.ticket.type - return urljoin(settings.SITE_URL, const.TICKET_DETAIL_URL.format(id=str(self.ticket.id))) + return urljoin( + settings.SITE_URL, + const.TICKET_DETAIL_URL.format( + id=str(self.ticket.id), + type=tp + ) + ) @property def content_title(self):