Skip to content

Commit

Permalink
dont directly return dsl until search_results finishes handle_search_…
Browse files Browse the repository at this point in the history
…results_query, re #11386
  • Loading branch information
whatisgalen committed Aug 22, 2024
1 parent 836ef36 commit 3b7b362
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions arches/app/search/components/base_search_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ def handle_search_results_query(
search_filter.append_dsl(search_query_object)

if returnDsl:
dsl = search_query_object.pop("query", None)
return dsl, search_query_object
return None, search_query_object

for filter_type, querystring in list(sorted_query_obj.items()):
search_filter = search_filter_factory.get_filter(filter_type)
Expand Down
3 changes: 1 addition & 2 deletions arches/app/search/components/standard_search_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ def handle_search_results_query(
return JSONErrorResponse(message=str(err))

if returnDsl:
dsl = search_query_object.pop("query", None)
return dsl, search_query_object
return None, search_query_object

for filter_type, querystring in list(sorted_query_obj.items()):
search_filter = search_filter_factory.get_filter(filter_type)
Expand Down
5 changes: 3 additions & 2 deletions arches/app/views/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,10 @@ def search_results(request, returnDsl=False):
)
)

if returnDsl:
return search_query_object.pop("query")

if response_object:
if returnDsl:
return response_object
return JSONResponse(content=response_object)

else:
Expand Down

0 comments on commit 3b7b362

Please sign in to comment.