mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-06-26 00:40:41 +00:00
Updates ignore boost logic that no longer produces errors
This commit is contained in:
parent
3e54a5f4a3
commit
9d275db322
|
@ -116,11 +116,8 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||||
def ignore_activity(cls, activity): # pylint: disable=too-many-return-statements
|
def ignore_activity(cls, activity): # pylint: disable=too-many-return-statements
|
||||||
"""keep notes if they are replies to existing statuses"""
|
"""keep notes if they are replies to existing statuses"""
|
||||||
if activity.type == "Announce":
|
if activity.type == "Announce":
|
||||||
try:
|
boosted = activitypub.resolve_remote_id(activity.object, get_activity=True)
|
||||||
boosted = activitypub.resolve_remote_id(
|
if not boosted:
|
||||||
activity.object, get_activity=True
|
|
||||||
)
|
|
||||||
except activitypub.ActivitySerializerError:
|
|
||||||
# if we can't load the status, definitely ignore it
|
# if we can't load the status, definitely ignore it
|
||||||
return True
|
return True
|
||||||
# keep the boost if we would keep the status
|
# keep the boost if we would keep the status
|
||||||
|
|
|
@ -462,6 +462,8 @@ class Status(TestCase):
|
||||||
@responses.activate
|
@responses.activate
|
||||||
def test_ignore_activity_boost(self, *_):
|
def test_ignore_activity_boost(self, *_):
|
||||||
"""don't bother with most remote statuses"""
|
"""don't bother with most remote statuses"""
|
||||||
|
responses.add(responses.GET, "http://fish.com/nothing")
|
||||||
|
|
||||||
activity = activitypub.Announce(
|
activity = activitypub.Announce(
|
||||||
id="http://www.faraway.com/boost/12",
|
id="http://www.faraway.com/boost/12",
|
||||||
actor=self.remote_user.remote_id,
|
actor=self.remote_user.remote_id,
|
||||||
|
|
Loading…
Reference in a new issue