File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 33from fastapi import APIRouter , Query , Request
44from fastapi .responses import JSONResponse
55
6- from openlibrary .plugins .worksearch .code import validate_search_json_query , work_search_async
6+ from openlibrary .plugins .worksearch .code import (
7+ validate_search_json_query ,
8+ work_search_async ,
9+ )
710from openlibrary .plugins .worksearch .schemes .works import WorkSearchScheme
811
912router = APIRouter ()
Original file line number Diff line number Diff line change @@ -1242,11 +1242,13 @@ async def work_search_async(
12421242def validate_search_json_query (q : str | None ) -> str | None :
12431243 if q and len (q ) < 3 :
12441244 return 'Query too short, must be at least 3 characters'
1245-
1245+
12461246 BLOCKED_QUERIES = {'the' }
12471247 if q and q .lower () in BLOCKED_QUERIES :
1248- return f"Invalid query; the following queries are not allowed: { ', ' .join (sorted (BLOCKED_QUERIES ))} " ,
1249-
1248+ return (
1249+ f"Invalid query; the following queries are not allowed: { ', ' .join (sorted (BLOCKED_QUERIES ))} " ,
1250+ )
1251+
12501252 return None
12511253
12521254
You can’t perform that action at this time.
0 commit comments