From 157cb872a7131ddb0c519a6b35c17595f7bff110 Mon Sep 17 00:00:00 2001 From: Nathan Gill Date: Mon, 3 Nov 2025 18:45:33 +0000 Subject: [PATCH 1/2] remove unused messages that interfered with homepage --- shepherd/blueprints/upload/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/shepherd/blueprints/upload/__init__.py b/shepherd/blueprints/upload/__init__.py index 952a181..145d0ea 100644 --- a/shepherd/blueprints/upload/__init__.py +++ b/shepherd/blueprints/upload/__init__.py @@ -25,15 +25,11 @@ def upload(): file = request.files["uploaded_file"] except KeyError: abort(400) - if file.filename == "": - flash("You didn't upload a file.", "error") - else: - flash("Got a file with filename {}".format(file.filename), "debug") + if file.filename != "": err = process_uploaded_file(file) if err: - flash(err, "error") + return f"{err}", 400 else: - flash("Your file looks good!", "success") # TODO: run a linter on the code? run.send("upload") return "", 204 From d200d3a1ed3544cf3747de8cbbb42bbb6baa9ec9 Mon Sep 17 00:00:00 2001 From: Nathan Gill Date: Wed, 5 Nov 2025 15:02:13 +0000 Subject: [PATCH 2/2] change inotify flag to stop helper sending too many issues --- helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper.py b/helper.py index 7c0cc7e..9a29051 100755 --- a/helper.py +++ b/helper.py @@ -48,7 +48,7 @@ wait_between_attempts = 0.1 picture_watcher.watch( - alias="image", path=img_input_file, flags=aionotify.Flags.MODIFY + alias="image", path=img_input_file, flags=aionotify.Flags.CLOSE_WRITE ) # sets up watcher