Updates ignore boost logic that no longer produces errors

This commit is contained in:
Mouse Reeve 2022-05-26 09:57:39 -07:00
parent 3e54a5f4a3
commit 9d275db322
2 changed files with 4 additions and 5 deletions

View file

@ -116,11 +116,8 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
def ignore_activity(cls, activity): # pylint: disable=too-many-return-statements
"""keep notes if they are replies to existing statuses"""
if activity.type == "Announce":
try:
boosted = activitypub.resolve_remote_id(
activity.object, get_activity=True
)
except activitypub.ActivitySerializerError:
boosted = activitypub.resolve_remote_id(activity.object, get_activity=True)
if not boosted:
# if we can't load the status, definitely ignore it
return True
# keep the boost if we would keep the status

View file

@ -462,6 +462,8 @@ class Status(TestCase):
@responses.activate
def test_ignore_activity_boost(self, *_):
"""don't bother with most remote statuses"""
responses.add(responses.GET, "http://fish.com/nothing")
activity = activitypub.Announce(
id="http://www.faraway.com/boost/12",
actor=self.remote_user.remote_id,