Skip to content

Commit

Permalink
Use consistent filename for JPEG files
Browse files Browse the repository at this point in the history
Fixes #505
  • Loading branch information
rubenwardy committed Jan 28, 2024
1 parent 50b8602 commit 142dfef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/logic/uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,17 @@ def upload_file(file, file_type, file_type_desc):

is_image = False
if file_type == "image":
allowed_extensions = ["jpg", "jpeg", "png", "webp"]
allowed_extensions = ["jpg", "png", "webp"]
is_image = True
elif file_type == "zip":
allowed_extensions = ["zip"]
else:
raise Exception("Invalid fileType")

ext = get_extension(file.filename)
if ext == "jpeg":
ext = "jpg"

if ext is None or ext not in allowed_extensions:
raise LogicError(400, lazy_gettext("Please upload %(file_desc)s", file_desc=file_type_desc))

Expand Down

0 comments on commit 142dfef

Please sign in to comment.