mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user