mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: logo upload issue
This commit is contained in:
parent
548de5da7e
commit
6b0df500ef
1 changed files with 5 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
from uuid import uuid4
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
|
||||
async def upload_org_logo(logo_file):
|
||||
|
|
@ -15,7 +16,10 @@ async def upload_org_logo(logo_file):
|
|||
f.close()
|
||||
|
||||
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:
|
||||
logo_file.file.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue