Timothy Jaeryang Baek 3 月之前
父节点
当前提交
41904f21e4
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      backend/open_webui/routers/files.py

+ 4 - 5
backend/open_webui/routers/files.py

@@ -453,11 +453,10 @@ async def get_html_file_content_by_id(id: str, user=Depends(get_verified_user)):
 
     file_user = Users.get_user_by_id(file.user_id)
     if not file_user.role == "admin":
-        if not file_user:
-            raise HTTPException(
-                status_code=status.HTTP_404_NOT_FOUND,
-                detail=ERROR_MESSAGES.NOT_FOUND,
-            )
+        raise HTTPException(
+            status_code=status.HTTP_404_NOT_FOUND,
+            detail=ERROR_MESSAGES.NOT_FOUND,
+        )
 
     if (
         file.user_id == user.id