From 04d20852765f238204e3a5434872b9cd24a4377c Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 23 Mar 2021 07:01:49 -0700 Subject: [PATCH] Create feeds on user registration --- bookwyrm/activitystreams.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bookwyrm/activitystreams.py b/bookwyrm/activitystreams.py index dfffd4905..6182f510b 100644 --- a/bookwyrm/activitystreams.py +++ b/bookwyrm/activitystreams.py @@ -217,3 +217,14 @@ def remove_statuses_on_block(sender, instance, *args, **kwargs): # and in both directions stream.remove_user_statuses(instance.user_subject, instance.user_object) stream.remove_user_statuses(instance.user_object, instance.user_subject) + + +@receiver(signals.post_save, sender=models.User) +# pylint: disable=unused-argument +def populate_feed_on_account_create(sender, instance, created, *args, **kwargs): + """ build a user's feeds when they join """ + if not created or not instance.local: + return + + for stream in streams.values(): + stream.populate_stream(instance)