mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
Check if content is present before removing
This commit is contained in:
parent
12c7ecf0f4
commit
b1ef53873f
1 changed files with 4 additions and 2 deletions
|
|
@ -173,7 +173,8 @@ async def list_files(user=Depends(get_verified_user), content: bool = Query(True
|
||||||
|
|
||||||
if not content:
|
if not content:
|
||||||
for file in files:
|
for file in files:
|
||||||
del file.data["content"]
|
if "content" in file.data:
|
||||||
|
del file.data["content"]
|
||||||
|
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
|
@ -214,7 +215,8 @@ async def search_files(
|
||||||
|
|
||||||
if not content:
|
if not content:
|
||||||
for file in matching_files:
|
for file in matching_files:
|
||||||
del file.data["content"]
|
if "content" in file.data:
|
||||||
|
del file.data["content"]
|
||||||
|
|
||||||
return matching_files
|
return matching_files
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue