File tree Expand file tree Collapse file tree
shepherd/blueprints/upload Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848wait_between_attempts = 0.1
4949
5050picture_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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments