Ryan Barrett 2023-11-03 06:52:07 -07:00
rodzic 625eb66d53
commit 1f6a227aee
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 13 dodań i 1 usunięć

Wyświetl plik

@ -862,7 +862,7 @@ class Object(StringIdModel):
elif set(actor.keys()) == {'id'}:
return common.pretty_link(actor['id'], attrs=attrs)
url = util.get_first(actor, 'url') or ''
url = as1.get_url(actor)
name = actor.get('displayName') or actor.get('username') or ''
img_url = util.get_url(actor, 'image')
if not image or not img_url:

Wyświetl plik

@ -488,6 +488,18 @@ class ObjectTest(TestCase):
Alice
</a>""", obj.actor_link(sized=True))
def test_actor_link_composite_url(self):
obj = Object(id='x', our_as1={
'actor': {
'url': {
'value': 'https://mas.to/@foo',
}
},
})
self.assert_multiline_equals(
'<a class="h-card u-author" href="https://mas.to/@foo">mas.to/@foo</a>',
obj.actor_link(image=False))
def test_put_updates_load_cache(self):
obj = Object(id='x', as2={})
obj.put()