More fixes (from the test instance)

This commit is contained in:
Thomas Sileo 2022-07-05 08:33:39 +02:00
parent e6066cb212
commit 1f6d6c5477
3 changed files with 6 additions and 3 deletions

View file

@ -211,7 +211,9 @@ async def admin_inbox(
(
await db_session.scalars(
q.options(
joinedload(models.InboxObject.relates_to_inbox_object),
joinedload(models.InboxObject.relates_to_inbox_object).options(
joinedload(models.InboxObject.actor)
),
joinedload(models.InboxObject.relates_to_outbox_object).options(
joinedload(
models.OutboxObject.outbox_object_attachments

View file

@ -886,6 +886,7 @@ async def get_replies_tree(
select(models.InboxObject)
.where(
models.InboxObject.ap_context == requested_object.ap_context,
models.InboxObject.ap_type.not_in(["Announce"]),
)
.options(joinedload(models.InboxObject.actor))
)
@ -917,7 +918,7 @@ async def get_replies_tree(
logger.info(nodes_by_in_reply_to)
if len(nodes_by_in_reply_to.get(None, [])) > 1:
raise ValueError("Invalid replies tree")
raise ValueError(f"Invalid replies tree: {[n.ap_object for n in tree_nodes]}")
def _get_reply_node_children(
node: ReplyTreeNode,

View file

@ -14,7 +14,7 @@
{% for inbox_object in inbox %}
{% if inbox_object.ap_type == "Announce" %}
{{ actor_action(inbox_object, "shared one of your post") }}
{{ actor_action(inbox_object, "shared") }}
{{ utils.display_object(inbox_object.relates_to_anybox_object) }}
{% elif inbox_object.ap_type in ["Article", "Note", "Video"] %}
{{ utils.display_object(inbox_object) }}