Browse Source

simplify logic

Juan Calderon-Perez 6 months ago
parent
commit
7c1b004687
1 changed files with 2 additions and 6 deletions
  1. 2 6
      backend/open_webui/routers/files.py

+ 2 - 6
backend/open_webui/routers/files.py

@@ -205,12 +205,8 @@ async def search_files(
     # Retrieve files from cache
     files = get_all_files_for_user(user.id, user.role == "admin")
 
-    # Normalize pattern and file names
-    normalized_pattern = normalize_text(filename).lower()
-    matching_files = [
-        file for file in files
-        if fnmatch(normalize_text(file.filename).lower(), normalized_pattern)
-    ]
+    # Get matching files
+    matching_files = [file for file in files if fnmatch(file.filename.lower(), filename.lower())]
     
     if not matching_files:
         raise HTTPException(