mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Merge pull request #2515 from bookwyrm-social/import-statuses
Don't add imported reviews to timelines
This commit is contained in:
commit
37bd90e88b
2 changed files with 5 additions and 1 deletions
|
@ -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(
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue