Fix for empty filename during edit
This commit is contained in:
parent
7dac87fa5d
commit
34abf95fb2
2
cps/web.py
Executable file → Normal file
2
cps/web.py
Executable file → Normal file
|
@ -3055,6 +3055,8 @@ def edit_book(book_id):
|
||||||
# Check and handle Uploaded file
|
# Check and handle Uploaded file
|
||||||
if 'btn-upload-format' in request.files:
|
if 'btn-upload-format' in request.files:
|
||||||
requested_file = request.files['btn-upload-format']
|
requested_file = request.files['btn-upload-format']
|
||||||
|
# check for empty request
|
||||||
|
if requested_file.filename != '':
|
||||||
if '.' in requested_file.filename:
|
if '.' in requested_file.filename:
|
||||||
file_ext = requested_file.filename.rsplit('.', 1)[-1].lower()
|
file_ext = requested_file.filename.rsplit('.', 1)[-1].lower()
|
||||||
if file_ext not in ALLOWED_EXTENSIONS:
|
if file_ext not in ALLOWED_EXTENSIONS:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user