From 281f1425de3c34a0b4f23e0b566c207f7e92943d Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Mon, 15 May 2023 09:49:45 +0200 Subject: [PATCH] Fix --- fastapi_book_server/app/services/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi_book_server/app/services/common.py b/fastapi_book_server/app/services/common.py index f6c27d3..44a0f53 100644 --- a/fastapi_book_server/app/services/common.py +++ b/fastapi_book_server/app/services/common.py @@ -325,7 +325,7 @@ class GetRandomService(Generic[MODEL, QUERY], BaseService[MODEL, QUERY]): await cls.cache_object_ids(query, object_ids, redis) - if len(object_ids): + if len(object_ids) == 0: return None return choice(object_ids)