Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
8 changes: 2 additions & 6 deletions shepherd/blueprints/upload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading