-
Notifications
You must be signed in to change notification settings - Fork 15
Labels
bugSomething is not working as expectedSomething is not working as expecteddiscussionRequires developer feedback/discussion before implementationRequires developer feedback/discussion before implementationnotificationAffects the notification systemAffects the notification systemnotifications
Description
Whenever we use Event.objects.bulk_create we do not send any signals, which means we cannot send any notifications. It is easy to override Event.objects.bulk_create to force it to send signals:
from django.db.models.signals import post_save
…
class EventQuerySet(models.QuerySet):
def bulk_create(self, objs, **kwargs):
objs = tuple(objs)
qs = super().bulk_create(objs, **kwargs)
for event in objs:
post_save.send(event.__class__, instance=event, created=True)
class Event(models.Model):
…
objects = EventQuerySet.as_manager()
…
… but if we do, everybody will get A LOT more notifications. There are mitigations like only sending notifications for some event types, like only open/close/end/reopen via the fallback filter setting, but it needs to be flagged to end users, loudly.
We could also stop using bulk_create and make our own method, freeing bulk_create to be used as was designed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething is not working as expectedSomething is not working as expecteddiscussionRequires developer feedback/discussion before implementationRequires developer feedback/discussion before implementationnotificationAffects the notification systemAffects the notification systemnotifications
Type
Projects
Status
📋 Backlog