mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 07:53:19 +01:00
notify_followup_webhooks used in email, so moving signal triggering code
This commit is contained in:
parent
0e96909f43
commit
79b7ce9650
@ -8,14 +8,11 @@ from .signals import update_ticket_done
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# listener is loaded via app.py HelpdeskConfig.ready()
|
def notify_followup_webhooks(followup):
|
||||||
@receiver(update_ticket_done)
|
|
||||||
def notify_followup_webhooks(sender, followup, **kwargs):
|
|
||||||
urls = settings.HELPDESK_GET_FOLLOWUP_WEBHOOK_URLS()
|
urls = settings.HELPDESK_GET_FOLLOWUP_WEBHOOK_URLS()
|
||||||
if not urls:
|
if not urls:
|
||||||
return
|
return
|
||||||
|
|
||||||
if sender == "update_ticket":
|
|
||||||
# Serialize the ticket associated with the followup
|
# Serialize the ticket associated with the followup
|
||||||
from .serializers import TicketSerializer
|
from .serializers import TicketSerializer
|
||||||
ticket = followup.ticket
|
ticket = followup.ticket
|
||||||
@ -36,6 +33,13 @@ def notify_followup_webhooks(sender, followup, **kwargs):
|
|||||||
logger.error('Timeout while sending followup webhook to %s', url)
|
logger.error('Timeout while sending followup webhook to %s', url)
|
||||||
|
|
||||||
|
|
||||||
|
# listener is loaded via app.py HelpdeskConfig.ready()
|
||||||
|
@receiver(update_ticket_done)
|
||||||
|
def notify_followup_webhooks_receiver(sender, followup, **kwargs):
|
||||||
|
if sender == "update_ticket":
|
||||||
|
notify_followup_webhooks(followup)
|
||||||
|
|
||||||
|
|
||||||
def send_new_ticket_webhook(ticket):
|
def send_new_ticket_webhook(ticket):
|
||||||
urls = settings.HELPDESK_GET_NEW_TICKET_WEBHOOK_URLS()
|
urls = settings.HELPDESK_GET_NEW_TICKET_WEBHOOK_URLS()
|
||||||
if not urls:
|
if not urls:
|
||||||
|
Loading…
Reference in New Issue
Block a user