forked from CGM_Public/pretix_original
Implement notifications for admin users (#700)
* First stab at notification settings * Add "global" setting for notification levels * Trigger notification task * Get users with permission for event * Actually send notification emails * More notifications * Allow to turn off notifications * Link in email to pause all notifications * Add NotificationType to wordlist * Add notification tests * Add documentation * Rebase fixes
This commit is contained in:
@@ -47,6 +47,8 @@ class LoggingMixin:
|
||||
"""
|
||||
from .log import LogEntry
|
||||
from .event import Event
|
||||
from ..notifications import get_all_notification_types
|
||||
from ..services.notifications import notify
|
||||
|
||||
event = None
|
||||
if isinstance(self, Event):
|
||||
@@ -60,6 +62,9 @@ class LoggingMixin:
|
||||
logentry.data = json.dumps(data, cls=CustomJSONEncoder)
|
||||
logentry.save()
|
||||
|
||||
if action in get_all_notification_types():
|
||||
notify.apply_async(args=(logentry.pk,))
|
||||
|
||||
|
||||
class LoggedModel(models.Model, LoggingMixin):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user