Select the outbox object types that we want to show on the notes page
instead of removing objects that we don't want to show.
That way, it's easier to ensure that there are no objects messing up the
object count/empty checks.
Partially fixes https://todo.sr.ht/~tsileo/microblog.pub/65
---
app/main.py | 2 +-
app/templates/index.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/main.py b/app/main.py
index c63ea3e..25882f4 100644
--- a/app/main.py
+++ b/app/main.py
@@ -296,7 +296,7 @@ async def index(
models.OutboxObject.visibility == ap.VisibilityEnum.PUBLIC,
models.OutboxObject.is_deleted.is_(False),
models.OutboxObject.is_hidden_from_homepage.is_(False),
- models.OutboxObject.ap_type != "Article",
+ models.OutboxObject.ap_type.in_(["Announce", "Note", "Video", "Question"]),
)
q = select(models.OutboxObject).where(*where)
total_count = await db_session.scalar(
diff --git a/app/templates/index.html b/app/templates/index.html
index f612102..5f5f4a7 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -26,7 +26,7 @@
<div class="h-feed">
<data class="p-name" value="{{ local_actor.display_name}}'s notes"></data>
{% for outbox_object in objects %}
- {% if outbox_object.ap_type in ["Note", "Article", "Video", "Question"] %}
+ {% if outbox_object.ap_type in ["Note", "Video", "Question"] %}
{{ utils.display_object(outbox_object) }}
{% elif outbox_object.ap_type == "Announce" %}
<div class="h-entry" id="{{ outbox_object.permalink_id }}">
--
2.38.1.windows.1