mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-21 23:43:11 +01:00
Add a signal when the ticket upate is done (every related instance created and updated)
This commit is contained in:
parent
8fffae343c
commit
2499f81d4d
@ -4,6 +4,7 @@ from django.core.exceptions import ValidationError
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext as _
|
||||
import django.dispatch
|
||||
|
||||
from helpdesk.lib import safe_template_context
|
||||
from helpdesk import settings as helpdesk_settings
|
||||
@ -20,6 +21,8 @@ from helpdesk.models import (
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
update_ticket_done = django.dispatch.Signal()
|
||||
|
||||
def add_staff_subscription(
|
||||
user: User,
|
||||
ticket: Ticket
|
||||
@ -387,6 +390,9 @@ def update_ticket(
|
||||
))
|
||||
ticket.save()
|
||||
|
||||
# emit signal with followup when the ticket update is done
|
||||
update_ticket_done.send(sender="update_ticket", followup=f)
|
||||
|
||||
from helpdesk.webhooks import notify_followup_webhooks
|
||||
notify_followup_webhooks(f)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user