From 10676b039a220611e337774170494fa610b22bd0 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sat, 9 Jul 2022 19:26:18 +0200 Subject: [PATCH] Fix lookup for custom actor types --- README.md | 2 ++ app/templates.py | 1 + app/templates/lookup.html | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4341408..1f0476f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # 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?) [![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) diff --git a/app/templates.py b/app/templates.py index b799519..8c86f36 100644 --- a/app/templates.py +++ b/app/templates.py @@ -111,6 +111,7 @@ async def render_template( "following_count": await db_session.scalar( select(func.count(models.Following.id)) ), + "actor_types": ap.ACTOR_TYPES, **template_args, }, ) diff --git a/app/templates/lookup.html b/app/templates/lookup.html index 0c7b940..010d6cd 100644 --- a/app/templates/lookup.html +++ b/app/templates/lookup.html @@ -11,7 +11,7 @@ - {% 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) }} {% elif ap_object %} {{ utils.display_object_expanded(ap_object) }}