Skip to content

Commit 4945eac

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f99452e commit 4945eac

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

openlibrary/fastapi/search.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
from fastapi import APIRouter, Query, Request
44
from 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+
)
710
from openlibrary.plugins.worksearch.schemes.works import WorkSearchScheme
811

912
router = APIRouter()

openlibrary/plugins/worksearch/code.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,11 +1242,13 @@ async def work_search_async(
12421242
def 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

0 commit comments

Comments
 (0)