Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#1170 from hanshuaikang/feature/dev…
Browse files Browse the repository at this point in the history
…elop_by_han

minor: 通知加上步骤ID
  • Loading branch information
hanshuaikang authored Aug 17, 2023
2 parents babd4cc + 3368bdb commit ea3aa59
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 ea3aa59

Please sign in to comment.