mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-25 01:13:31 +01:00
Use update_ticket mechanism in email.py
This commit is contained in:
parent
79b7ce9650
commit
c0ee8e0847
@ -25,6 +25,7 @@ from helpdesk import webhooks
|
|||||||
from helpdesk.exceptions import DeleteIgnoredTicketException, IgnoreTicketException
|
from helpdesk.exceptions import DeleteIgnoredTicketException, IgnoreTicketException
|
||||||
from helpdesk.lib import process_attachments, safe_template_context
|
from helpdesk.lib import process_attachments, safe_template_context
|
||||||
from helpdesk.models import FollowUp, IgnoreEmail, Queue, Ticket
|
from helpdesk.models import FollowUp, IgnoreEmail, Queue, Ticket
|
||||||
|
from helpdesk.signals import update_ticket_done
|
||||||
import imaplib
|
import imaplib
|
||||||
import logging
|
import logging
|
||||||
import mimetypes
|
import mimetypes
|
||||||
@ -618,7 +619,8 @@ def create_object_from_email_message(message, ticket_id, payload, files, logger)
|
|||||||
else:
|
else:
|
||||||
send_info_email(message_id, f, ticket, context, queue, new)
|
send_info_email(message_id, f, ticket, context, queue, new)
|
||||||
if not new:
|
if not new:
|
||||||
webhooks.notify_followup_webhooks(f)
|
# emit signal with followup when the ticket is updated
|
||||||
|
update_ticket_done.send(sender="create_object_from_email_message", followup=f)
|
||||||
return ticket
|
return ticket
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,8 +36,7 @@ def notify_followup_webhooks(followup):
|
|||||||
# listener is loaded via app.py HelpdeskConfig.ready()
|
# listener is loaded via app.py HelpdeskConfig.ready()
|
||||||
@receiver(update_ticket_done)
|
@receiver(update_ticket_done)
|
||||||
def notify_followup_webhooks_receiver(sender, followup, **kwargs):
|
def notify_followup_webhooks_receiver(sender, followup, **kwargs):
|
||||||
if sender == "update_ticket":
|
notify_followup_webhooks(followup)
|
||||||
notify_followup_webhooks(followup)
|
|
||||||
|
|
||||||
|
|
||||||
def send_new_ticket_webhook(ticket):
|
def send_new_ticket_webhook(ticket):
|
||||||
|
Loading…
Reference in New Issue
Block a user