From 7f4c085700d3eb57d71b8a9f5e654348e8becb87 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 3 Sep 2024 09:19:24 -0400 Subject: [PATCH] only send notifs on NEW blogposts s Signed-off-by: Jason --- core/api/views/notifs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/api/views/notifs.py b/core/api/views/notifs.py index e9aa590c..8779f14f 100644 --- a/core/api/views/notifs.py +++ b/core/api/views/notifs.py @@ -29,6 +29,9 @@ def announcement_change(sender, **kwargs): @receiver(signals.post_save, sender=models.BlogPost) def blogpost_change(sender, **kwargs): + if not kwargs["created"]: + return # only send notifs on new blogposts + global_notifs.send("blogpost_change", orig_sender=sender, kwargs=kwargs) if not settings.NOTIF_DRY_RUN: tasks.notif_broker_blogpost.delay(kwargs["instance"].id)