Add notification signal (Z:#23127501) (#3725)

* Add and send signal for refund requests

* Add and send signal for notifications

* Revert changes

* Fix typo

Co-authored-by: Mira <weller@rami.io>

* Document parameters

---------

Co-authored-by: Mira <weller@rami.io>
This commit is contained in:
Phin Wolkwitz
2023-11-20 11:33:12 +01:00
committed by GitHub
parent 78acd8d118
commit 78609613bc
2 changed files with 12 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ from pretix.base.models import LogEntry, NotificationSetting, User
from pretix.base.notifications import Notification, get_all_notification_types
from pretix.base.services.mail import mail_send_task
from pretix.base.services.tasks import ProfiledTask, TransactionAwareTask
from pretix.base.signals import notification
from pretix.celery_app import app
from pretix.helpers.urls import build_absolute_uri
@@ -90,6 +91,8 @@ def notify(logentry_ids: list):
if enabled and um not in notify_specific:
send_notification.apply_async(args=(logentry.id, notification_type.action_type, user.pk, method))
notification.send(logentry.event, logentry_id=logentry.id, notification_type=notification_type.action_type)
@app.task(base=ProfiledTask, acks_late=True, max_retries=9, default_retry_delay=900)
def send_notification(logentry_id: int, action_type: str, user_id: int, method: str):