Fix for empty filename during edit

This commit is contained in:
Ozzie Isaacs 2018-08-18 22:00:43 +02:00
parent 7dac87fa5d
commit 34abf95fb2

2
cps/web.py Executable file → Normal file
View File

@ -3055,6 +3055,8 @@ def edit_book(book_id):
# Check and handle Uploaded file
if 'btn-upload-format' in request.files:
requested_file = request.files['btn-upload-format']
# check for empty request
if requested_file.filename != '':
if '.' in requested_file.filename:
file_ext = requested_file.filename.rsplit('.', 1)[-1].lower()
if file_ext not in ALLOWED_EXTENSIONS: