Skip to content

Commit 4bbae2f

Browse files
authored
Merge pull request #62 from systemetric/helper-images-fix
Helper images fix
2 parents c62a32b + d200d3a commit 4bbae2f

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
wait_between_attempts = 0.1
4949

5050
picture_watcher.watch(
51-
alias="image", path=img_input_file, flags=aionotify.Flags.MODIFY
51+
alias="image", path=img_input_file, flags=aionotify.Flags.CLOSE_WRITE
5252
) # sets up watcher
5353

5454

shepherd/blueprints/upload/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,11 @@ def upload():
2525
file = request.files["uploaded_file"]
2626
except KeyError:
2727
abort(400)
28-
if file.filename == "":
29-
flash("You didn't upload a file.", "error")
30-
else:
31-
flash("Got a file with filename {}".format(file.filename), "debug")
28+
if file.filename != "":
3229
err = process_uploaded_file(file)
3330
if err:
34-
flash(err, "error")
31+
return f"{err}", 400
3532
else:
36-
flash("Your file looks good!", "success") # TODO: run a linter on the code?
3733
run.send("upload")
3834
return "", 204
3935

0 commit comments

Comments
 (0)