From 443506c425f4aba3e399e21c96efba971f7cb38b Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Mon, 27 Nov 2023 11:51:52 -0800 Subject: [PATCH] activitypub.postprocess_as2_actor: remove obsolete wrap kwarg --- activitypub.py | 6 +++--- tests/test_web.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/activitypub.py b/activitypub.py index 2d0cab1..acbfbe7 100644 --- a/activitypub.py +++ b/activitypub.py @@ -685,14 +685,14 @@ def postprocess_as2(activity, orig_obj=None, wrap=True): return util.trim_nulls(activity) -def postprocess_as2_actor(actor, user=None, wrap=True): +def postprocess_as2_actor(actor, user=None): """Prepare an AS2 actor object to be served or sent via ActivityPub. Modifies actor in place. Args: actor (dict): AS2 actor object - wrap (bool): whether to wrap url + user (models.User): current user Returns: actor dict @@ -706,7 +706,7 @@ def postprocess_as2_actor(actor, user=None, wrap=True): urls = util.get_list(actor, 'url') if not urls and url: urls = [url] - if urls and wrap: + if urls: urls[0] = redirect_wrap(urls[0]) id = actor.get('id') diff --git a/tests/test_web.py b/tests/test_web.py index d7dfff0..180813e 100644 --- a/tests/test_web.py +++ b/tests/test_web.py @@ -15,7 +15,7 @@ from werkzeug.exceptions import BadGateway, BadRequest # import first so that Fake is defined before URL routes are registered from . import testutil -from activitypub import ActivityPub, postprocess_as2 +from activitypub import ActivityPub import common from common import CONTENT_TYPE_HTML from models import Follower, Object