From 9059b78b57601c0dcdf79732515ab0150d59f2dc Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 3 Oct 2021 09:44:27 -0700 Subject: [PATCH] Fixes testing if endpoint got results --- bookwyrm/views/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/views/search.py b/bookwyrm/views/search.py index 4c19a193..33ce3706 100644 --- a/bookwyrm/views/search.py +++ b/bookwyrm/views/search.py @@ -71,7 +71,7 @@ def book_search(query, user, min_confidence, search_remote=False): """the real business is elsewhere""" # try a local-only search results = [{"results": search(query, min_confidence=min_confidence)}] - if not user.is_authenticated or (results and not search_remote): + if not user.is_authenticated or (results[0]["results"] and not search_remote): return results, False # if there were no local results, or the request was for remote, search all sources