forked from forks/microblog.pub
Fix DMs section
This commit is contained in:
parent
ce80e98d33
commit
1f36348021
1 changed files with 24 additions and 16 deletions
40
app/admin.py
40
app/admin.py
|
@ -497,31 +497,39 @@ async def admin_direct_messages(
|
||||||
)
|
)
|
||||||
last_from_inbox = (
|
last_from_inbox = (
|
||||||
(
|
(
|
||||||
await db_session.scalars(
|
(
|
||||||
select(models.InboxObject)
|
await db_session.scalars(
|
||||||
.where(or_(*convos_with_last_from_inbox))
|
select(models.InboxObject)
|
||||||
.options(
|
.where(or_(*convos_with_last_from_inbox))
|
||||||
joinedload(models.InboxObject.actor),
|
.options(
|
||||||
|
joinedload(models.InboxObject.actor),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
.unique()
|
||||||
|
.all()
|
||||||
)
|
)
|
||||||
.unique()
|
if convos_with_last_from_inbox
|
||||||
.all()
|
else []
|
||||||
)
|
)
|
||||||
last_from_outbox = (
|
last_from_outbox = (
|
||||||
(
|
(
|
||||||
await db_session.scalars(
|
(
|
||||||
select(models.OutboxObject)
|
await db_session.scalars(
|
||||||
.where(or_(*convos_with_last_from_outbox))
|
select(models.OutboxObject)
|
||||||
.options(
|
.where(or_(*convos_with_last_from_outbox))
|
||||||
joinedload(models.OutboxObject.outbox_object_attachments).options(
|
.options(
|
||||||
joinedload(models.OutboxObjectAttachment.upload)
|
joinedload(
|
||||||
),
|
models.OutboxObject.outbox_object_attachments
|
||||||
|
).options(joinedload(models.OutboxObjectAttachment.upload)),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
.unique()
|
||||||
|
.all()
|
||||||
)
|
)
|
||||||
.unique()
|
if convos_with_last_from_outbox
|
||||||
.all()
|
else []
|
||||||
)
|
)
|
||||||
|
|
||||||
# Build the template response
|
# Build the template response
|
||||||
|
|
Loading…
Reference in a new issue