Skip to content

Commit

Permalink
only send notifs on NEW blogposts s
Browse files Browse the repository at this point in the history
Signed-off-by: Jason <[email protected]>
  • Loading branch information
JasonLovesDoggo committed Sep 3, 2024
1 parent 4fdd3fb commit 7f4c085
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/api/views/notifs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7f4c085

Please sign in to comment.