From 41904f21e4c8b44e68115cf6b64d0d88e622c2d2 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 30 Apr 2025 19:41:16 +0400 Subject: [PATCH] refac --- backend/open_webui/routers/files.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/routers/files.py b/backend/open_webui/routers/files.py index 9ddbd2311..bc998dae8 100644 --- a/backend/open_webui/routers/files.py +++ b/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