~tsileo/microblog.pub-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Whitelist object types in the index query

João Costa <jdpc557@gmail.com>
Details
Message ID
<20221129220842.387-1-jdpc557@gmail.com>
DKIM signature
missing
Download raw message
Patch: +2 -2
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
Details
Message ID
<cc2fb476-c676-45a7-b9a0-499ed1153135@app.fastmail.com>
In-Reply-To
<20221129220842.387-1-jdpc557@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Hey,

I just applied the patch, thanks for your contribution!
Reply to thread Export thread (mbox)