fix: logo upload issue

This commit is contained in:
swve 2023-06-23 19:27:52 +02:00
parent 548de5da7e
commit 6b0df500ef

View file

@ -1,5 +1,6 @@
import os import os
from uuid import uuid4 from uuid import uuid4
from fastapi import HTTPException, status
async def upload_org_logo(logo_file): async def upload_org_logo(logo_file):
@ -15,7 +16,10 @@ async def upload_org_logo(logo_file):
f.close() f.close()
except Exception: except Exception:
return {"message": "There was an error uploading the file"} raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail="There was an error uploading the file",
)
finally: finally:
logo_file.file.close() logo_file.file.close()