kopia lustrzana https://github.com/snarfed/bridgy-fed
genericize user handles on UI follower/following pages
rodzic
004726d397
commit
1ec1fc2482
2
pages.py
2
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(),
|
||||
)
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
{% endif %}
|
||||
{% endwith %}
|
||||
{{ user_as1.get('displayName') or '' }}
|
||||
<!-- TODO: genericize -->
|
||||
{{ as2.address(ActivityPub.convert(f.user.obj, from_user=user) or url) or url }}
|
||||
{{ f.user.handle or url }}
|
||||
</a>
|
||||
{% endwith %}
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
Ładowanie…
Reference in New Issue