From 2fc95d165a9a5089dcef1fc592f764f5fa91d68f Mon Sep 17 00:00:00 2001 From: Sam Splunks <72095718+samsplunks@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:19:50 +0000 Subject: [PATCH] new_ticket_done signal emitted through email --- helpdesk/email.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helpdesk/email.py b/helpdesk/email.py index ea90ce65..c87e485c 100644 --- a/helpdesk/email.py +++ b/helpdesk/email.py @@ -24,7 +24,7 @@ from helpdesk import settings from helpdesk.exceptions import DeleteIgnoredTicketException, IgnoreTicketException from helpdesk.lib import process_attachments, safe_template_context from helpdesk.models import FollowUp, IgnoreEmail, Queue, Ticket -from helpdesk.signals import update_ticket_done +from helpdesk.signals import new_ticket_done, update_ticket_done import imaplib import logging import mimetypes @@ -617,7 +617,10 @@ def create_object_from_email_message(message, ticket_id, payload, files, logger) "Message seems to be auto-reply, not sending any emails back to the sender") else: send_info_email(message_id, f, ticket, context, queue, new) - if not new: + if new: + # emit signal when the PublicTicketForm.save is done + new_ticket_done.send(sender="create_object_from_email_message", ticket=ticket) + else: # emit signal with followup when the ticket is updated update_ticket_done.send(sender="create_object_from_email_message", followup=f) return ticket