1
0
mirror of https://git.sr.ht/~tsileo/microblog.pub synced 2025-06-05 21:59:23 +02:00

Add alt text support for attachments

This commit is contained in:
Thomas Sileo
2022-07-21 22:43:06 +02:00
parent a95dee9ef0
commit edae9a6b62
9 changed files with 74 additions and 12 deletions

View File

@ -662,10 +662,12 @@ async def admin_actions_new(
) -> RedirectResponse:
# XXX: for some reason, no files restuls in an empty single file
uploads = []
raw_form_data = await request.form()
if len(files) >= 1 and files[0].filename:
for f in files:
upload = await save_upload(db_session, f)
uploads.append((upload, f.filename))
uploads.append((upload, f.filename, raw_form_data.get("alt_" + f.filename)))
public_id = await boxes.send_create(
db_session,
source=content,