diff --git a/pages.py b/pages.py index cb3dc1f..d59bf1d 100644 --- a/pages.py +++ b/pages.py @@ -168,8 +168,6 @@ def followers_or_following(protocol, id, collection): f'{collection}.html', address=request.args.get('address'), follow_url=request.values.get('url'), - # TODO: remove - ActivityPub=PROTOCOLS['activitypub'], **TEMPLATE_VARS, **locals(), ) diff --git a/templates/_followers.html b/templates/_followers.html index b07af52..2a1aba2 100644 --- a/templates/_followers.html +++ b/templates/_followers.html @@ -11,8 +11,7 @@ {% endif %} {% endwith %} {{ user_as1.get('displayName') or '' }} - - {{ as2.address(ActivityPub.convert(f.user.obj, from_user=user) or url) or url }} + {{ f.user.handle or url }} {% endwith %} diff --git a/tests/test_pages.py b/tests/test_pages.py index 277c279..5465114 100644 --- a/tests/test_pages.py +++ b/tests/test_pages.py @@ -167,14 +167,14 @@ class PagesTest(TestCase): def test_followers(self): Follower.get_or_create( to=self.user, - from_=self.make_user('unused', cls=Fake, obj_as2={ + from_=self.make_user('http://unused', cls=ActivityPub, obj_as2={ **ACTOR, 'id': 'unused', 'url': 'http://stored/users/follow', })) Follower.get_or_create( to=self.user, - from_=self.make_user('masto/user', cls=Fake, + from_=self.make_user('http://masto/user', cls=ActivityPub, obj_as2=ACTOR_WITH_PREFERRED_USERNAME)) got = self.client.get('/web/user.com/followers') @@ -261,14 +261,14 @@ class PagesTest(TestCase): def test_following(self): Follower.get_or_create( from_=self.user, - to=self.make_user('unused', cls=Fake, obj_as2={ + to=self.make_user('http://unused', cls=ActivityPub, obj_as2={ **ACTOR, 'id': 'unused', 'url': 'http://stored/users/follow', })) Follower.get_or_create( from_=self.user, - to=self.make_user('masto/user', cls=Fake, + to=self.make_user('http://masto/user', cls=ActivityPub, obj_as2=ACTOR_WITH_PREFERRED_USERNAME)) got = self.client.get('/web/user.com/following') @@ -276,7 +276,7 @@ class PagesTest(TestCase): body = got.get_data(as_text=True) self.assertIn('@follow@stored', body) - self.assertIn('masto/user', body) + self.assertIn('@me@plus.google.com', body) def test_following_empty(self): got = self.client.get('/web/user.com/following')