From 01ff701fef6a613d5ee521261d67c3291bc851fa Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Mon, 2 Dec 2024 13:57:42 +0000 Subject: [PATCH] test handling alt from post request --- src/microcosm/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/microcosm/__init__.py b/src/microcosm/__init__.py index f9f96df..d9d2643 100644 --- a/src/microcosm/__init__.py +++ b/src/microcosm/__init__.py @@ -344,7 +344,12 @@ def process_multipart_post(): if "thumbnail" not in frontmatter: frontmatter["thumbnail"] = photo_url - frontmatter["photo"].append(photo_url) + if "mp-photo-alt[]" in request.form: + alt = request.form["mp-photo-alt[]"][i] + else: + alt = "" + + frontmatter["photo"].append({"value": photo_url, "alt": alt}) # docstr += f'\n\n'