Merge pull request #2515 from bookwyrm-social/import-statuses

Don't add imported reviews to timelines
This commit is contained in:
Mouse Reeve 2022-12-16 14:58:24 -08:00 committed by GitHub
commit 37bd90e88b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -318,6 +318,10 @@ def add_status_on_create_command(sender, instance, created):
if instance.published_date < timezone.now() - timedelta(
days=1
) or instance.created_date < instance.published_date - timedelta(days=1):
# a backdated status from a local user is an import, don't add it
if instance.user.local:
return
# an out of date remote status is a low priority but should be added
priority = LOW
add_status_task.apply_async(

View file

@ -63,7 +63,7 @@ class TransactionInboxCreate(TransactionTestCase):
with patch("bookwyrm.activitystreams.add_status_task.apply_async") as mock:
views.inbox.activity_task(activity)
self.assertEqual(mock.call_count, 2)
self.assertEqual(mock.call_count, 0)
@patch("bookwyrm.models.activitypub_mixin.broadcast_task.apply_async")