Fix lookup for custom actor types

main
Thomas Sileo 2022-07-09 19:26:18 +02:00
parent d60f3492db
commit 10676b039a
3 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,7 @@
# microblog.pub # microblog.pub
A self-hosted, single-user, ActivityPub powered microblog.
[![builds.sr.ht status](https://builds.sr.ht/~tsileo/microblog.pub.svg)](https://builds.sr.ht/~tsileo/microblog.pub?) [![builds.sr.ht status](https://builds.sr.ht/~tsileo/microblog.pub.svg)](https://builds.sr.ht/~tsileo/microblog.pub?)
[![AGPL 3.0](https://img.shields.io/badge/license-AGPL_3.0-blue.svg?style=flat)](https://git.sr.ht/~tsileo/microblog.pub/tree/v2/item/LICENSE) [![AGPL 3.0](https://img.shields.io/badge/license-AGPL_3.0-blue.svg?style=flat)](https://git.sr.ht/~tsileo/microblog.pub/tree/v2/item/LICENSE)

View File

@ -111,6 +111,7 @@ async def render_template(
"following_count": await db_session.scalar( "following_count": await db_session.scalar(
select(func.count(models.Following.id)) select(func.count(models.Following.id))
), ),
"actor_types": ap.ACTOR_TYPES,
**template_args, **template_args,
}, },
) )

View File

@ -11,7 +11,7 @@
</form> </form>
</div> </div>
{% if ap_object and ap_object.ap_type == "Person" %} {% if ap_object and ap_object.ap_type in actor_types %}
{{ utils.display_actor(ap_object, actors_metadata) }} {{ utils.display_actor(ap_object, actors_metadata) }}
{% elif ap_object %} {% elif ap_object %}
{{ utils.display_object_expanded(ap_object) }} {{ utils.display_object_expanded(ap_object) }}