Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix: fail to import recipe image (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBursch authored May 8, 2023
1 parent 93376f0 commit 1bc6bb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/service/file_has_access_or_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def file_has_access_or_download(newPhoto: str, oldPhoto: str = None) -> str:
from mimetypes import guess_extension
resp = requests.get(newPhoto)
ext = guess_extension(resp.headers['content-type'])
if allowed_file('file' + ext):
if ext and allowed_file('file' + ext):
filename = secure_filename(str(uuid.uuid4()) + ext)
File(filename=filename, created_by=current_user.id).save()
with open(os.path.join(UPLOAD_FOLDER, filename), "wb") as o:
Expand Down

0 comments on commit 1bc6bb4

Please sign in to comment.