Commit 34abf95f authored by Ozzie Isaacs's avatar Ozzie Isaacs

Fix for empty filename during edit

parent 7dac87fa
...@@ -3055,6 +3055,8 @@ def edit_book(book_id): ...@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment