Skip to content

Commit

Permalink
minor: 通知加上步骤ID
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshuaikang committed Aug 16, 2023
1 parent 99fc208 commit 3368bdb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions itsm/ticket/models/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,8 @@ def priority_name(self):
def ticket_url(self):
if not self.notify_url:
return "{site_url}/#/ticket/{ticket_id}/".format(
site_url=settings.TICKET_NOTIFY_HOST.rstrip("/"), ticket_id=self.id
site_url=settings.TICKET_NOTIFY_HOST.rstrip("/"),
ticket_id=self.id,
)
return self.notify_url

Expand Down Expand Up @@ -1552,11 +1553,12 @@ def generate_ticket_url(self, state_id, receivers):
}
)
client = Cache()
self.notify_url = "{site_url}/#/ticket/{ticket_id}/?token={token}&cache_key={cache_key}".format(
self.notify_url = "{site_url}/#/ticket/{ticket_id}/?token={token}&cache_key={cache_key}&step_id={step_id}".format( # noqa
site_url=settings.TICKET_NOTIFY_HOST.rstrip("/"),
ticket_id=self.id,
token=ticket_token,
cache_key=cache_key,
step_id=status.id,
)
data = json.dumps({"state_id": state_id, "ticket_id": self.id})
client.set(cache_key, data, 60 * 60 * 24 * 30)
Expand Down

0 comments on commit 3368bdb

Please sign in to comment.