mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 05:04:27 +00:00
Fix admin outbox query
This commit is contained in:
parent
d058c1ba26
commit
952b28ece7
1 changed files with 17 additions and 13 deletions
30
app/boxes.py
30
app/boxes.py
|
@ -454,24 +454,28 @@ async def get_outbox_object_by_ap_id(
|
||||||
db_session: AsyncSession, ap_id: str
|
db_session: AsyncSession, ap_id: str
|
||||||
) -> models.OutboxObject | None:
|
) -> models.OutboxObject | None:
|
||||||
return (
|
return (
|
||||||
await db_session.execute(
|
(
|
||||||
select(models.OutboxObject)
|
await db_session.execute(
|
||||||
.where(models.OutboxObject.ap_id == ap_id)
|
select(models.OutboxObject)
|
||||||
.options(
|
.where(models.OutboxObject.ap_id == ap_id)
|
||||||
joinedload(models.OutboxObject.outbox_object_attachments).options(
|
.options(
|
||||||
joinedload(models.OutboxObjectAttachment.upload)
|
|
||||||
),
|
|
||||||
joinedload(models.OutboxObject.relates_to_inbox_object).options(
|
|
||||||
joinedload(models.InboxObject.actor),
|
|
||||||
),
|
|
||||||
joinedload(models.OutboxObject.relates_to_outbox_object).options(
|
|
||||||
joinedload(models.OutboxObject.outbox_object_attachments).options(
|
joinedload(models.OutboxObject.outbox_object_attachments).options(
|
||||||
joinedload(models.OutboxObjectAttachment.upload)
|
joinedload(models.OutboxObjectAttachment.upload)
|
||||||
),
|
),
|
||||||
),
|
joinedload(models.OutboxObject.relates_to_inbox_object).options(
|
||||||
|
joinedload(models.InboxObject.actor),
|
||||||
|
),
|
||||||
|
joinedload(models.OutboxObject.relates_to_outbox_object).options(
|
||||||
|
joinedload(
|
||||||
|
models.OutboxObject.outbox_object_attachments
|
||||||
|
).options(joinedload(models.OutboxObjectAttachment.upload)),
|
||||||
|
),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
).scalar_one_or_none() # type: ignore
|
.unique()
|
||||||
|
.scalar_one_or_none()
|
||||||
|
) # type: ignore
|
||||||
|
|
||||||
|
|
||||||
async def get_anybox_object_by_ap_id(
|
async def get_anybox_object_by_ap_id(
|
||||||
|
|
Loading…
Reference in a new issue