mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 13:14:28 +00:00
Fix DMs section
This commit is contained in:
parent
ce80e98d33
commit
1f36348021
1 changed files with 24 additions and 16 deletions
14
app/admin.py
14
app/admin.py
|
@ -496,6 +496,7 @@ async def admin_direct_messages(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
last_from_inbox = (
|
last_from_inbox = (
|
||||||
|
(
|
||||||
(
|
(
|
||||||
await db_session.scalars(
|
await db_session.scalars(
|
||||||
select(models.InboxObject)
|
select(models.InboxObject)
|
||||||
|
@ -508,21 +509,28 @@ async def admin_direct_messages(
|
||||||
.unique()
|
.unique()
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
|
if convos_with_last_from_inbox
|
||||||
|
else []
|
||||||
|
)
|
||||||
last_from_outbox = (
|
last_from_outbox = (
|
||||||
|
(
|
||||||
(
|
(
|
||||||
await db_session.scalars(
|
await db_session.scalars(
|
||||||
select(models.OutboxObject)
|
select(models.OutboxObject)
|
||||||
.where(or_(*convos_with_last_from_outbox))
|
.where(or_(*convos_with_last_from_outbox))
|
||||||
.options(
|
.options(
|
||||||
joinedload(models.OutboxObject.outbox_object_attachments).options(
|
joinedload(
|
||||||
joinedload(models.OutboxObjectAttachment.upload)
|
models.OutboxObject.outbox_object_attachments
|
||||||
),
|
).options(joinedload(models.OutboxObjectAttachment.upload)),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.unique()
|
.unique()
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
|
if convos_with_last_from_outbox
|
||||||
|
else []
|
||||||
|
)
|
||||||
|
|
||||||
# Build the template response
|
# Build the template response
|
||||||
threads = []
|
threads = []
|
||||||
|
|
Loading…
Reference in a new issue