Attach send_new_ticket_webhook to the new_ticket_done signal

This commit is contained in:
Sam Splunks
2024-04-17 10:02:44 +00:00
parent c6cad5f702
commit 9a6939b564
4 changed files with 19 additions and 5 deletions

View File

@@ -36,6 +36,7 @@ from helpdesk.settings import (
CUSTOMFIELD_TO_FIELD_DICT
)
from helpdesk.validators import validate_file_extension
from helpdesk.signals import new_ticket_done
import logging
@@ -418,6 +419,10 @@ class TicketForm(AbstractTicketForm):
followup.save()
files = self._attach_files_to_follow_up(followup)
# emit signal when the TicketForm.save is done
new_ticket_done.send(sender="TicketForm", ticket=ticket)
self._send_messages(ticket=ticket,
queue=queue,
followup=followup,
@@ -507,6 +512,10 @@ class PublicTicketForm(AbstractTicketForm):
followup.save()
files = self._attach_files_to_follow_up(followup)
# emit signal when the PublicTicketForm.save is done
new_ticket_done.send(sender="PublicTicketForm", ticket=ticket)
self._send_messages(ticket=ticket,
queue=queue,
followup=followup,