From 85c1c7901ede0b7a23090ce2598785781f0ae8f4 Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Mon, 2 Dec 2024 14:54:38 +0000 Subject: [PATCH] better handling for alt text --- src/microcosm/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/microcosm/__init__.py b/src/microcosm/__init__.py index 30997dd..2246ce2 100644 --- a/src/microcosm/__init__.py +++ b/src/microcosm/__init__.py @@ -346,8 +346,9 @@ def process_multipart_post(): if "mp-photo-alt[]" in request.form: try: - alt = request.form["mp-photo-alt[]"][i] + alt = request.form.getlist('mp-photo-alt[]')[i] except: + print(f"No alt text specified for image {i}") alt = "" else: alt = ""