mirror of
https://github.com/open-webui/open-webui
synced 2025-05-17 12:03:41 +00:00
refac
This commit is contained in:
parent
a0fb4a9b84
commit
fb083237cd
@ -77,6 +77,7 @@ class FilesTable:
|
|||||||
**form_data.model_dump(),
|
**form_data.model_dump(),
|
||||||
"user_id": user_id,
|
"user_id": user_id,
|
||||||
"created_at": int(time.time()),
|
"created_at": int(time.time()),
|
||||||
|
"updated_at": int(time.time()),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ async def get_file_text_content_by_id(id: str, user=Depends(get_verified_user)):
|
|||||||
file = Files.get_file_by_id(id)
|
file = Files.get_file_by_id(id)
|
||||||
|
|
||||||
if file and (file.user_id == user.id or user.role == "admin"):
|
if file and (file.user_id == user.id or user.role == "admin"):
|
||||||
return {"text": file.meta.get("content", {}).get("text", None)}
|
return {"text": file.data.get("content")}
|
||||||
else:
|
else:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_404_NOT_FOUND,
|
status_code=status.HTTP_404_NOT_FOUND,
|
||||||
|
Loading…
Reference in New Issue
Block a user