From 5d686048e94617df1d40e550353c11d4d48e8ec9 Mon Sep 17 00:00:00 2001 From: Katy Baulch <46493669+katybaulch@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:08:07 +0000 Subject: [PATCH] Fix equality check for null corpus --- app/api/api_v1/routers/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/api_v1/routers/search.py b/app/api/api_v1/routers/search.py index a7749c33..a5d83a32 100644 --- a/app/api/api_v1/routers/search.py +++ b/app/api/api_v1/routers/search.py @@ -185,7 +185,7 @@ def search_documents( token.decode_and_validate(db, request, app_token) # If the search request IDs are null, we want to search using the app token corpora. - if search_body.corpus_import_ids is None: + if search_body.corpus_import_ids == [] or search_body.corpus_import_ids is None: search_body.corpus_import_ids = cast(Sequence, token.allowed_corpora_ids) # For the second validation, search request corpora Ids are validated against the