#1 Allow searches to be made from the main page
This commit is contained in:
0
utils/__init__.py
Normal file
0
utils/__init__.py
Normal file
11
utils/file_utils.py
Normal file
11
utils/file_utils.py
Normal file
@ -0,0 +1,11 @@
|
||||
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
|
||||
|
||||
|
||||
def allowed_file(filename):
|
||||
""" Ensures only filenames ending with the correct extension are allowed.
|
||||
Note: This does not verify that the content inside of the file
|
||||
matches the type specified
|
||||
"""
|
||||
return '.' in filename and \
|
||||
filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
|
||||
|
Reference in New Issue
Block a user