From 89d608abcfd54038578eb45d629a8519d4e87a21 Mon Sep 17 00:00:00 2001 From: ldeluigi <44567586+ldeluigi@users.noreply.github.com> Date: Tue, 2 May 2023 11:02:42 +0200 Subject: [PATCH] Optimize query by a lot --- backend/spellbook/parsers/variants_query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/spellbook/parsers/variants_query.py b/backend/spellbook/parsers/variants_query.py index 2b0190ec..8ed9f2dd 100644 --- a/backend/spellbook/parsers/variants_query.py +++ b/backend/spellbook/parsers/variants_query.py @@ -177,7 +177,7 @@ def tag_search(q: QuerySet, values: list[QueryValue]) -> QuerySet: case 'risky' | 'allin': tag_query &= Q(produces__name='Risky') case 'winning' | 'gamewinning': - tag_query &= Q(produces__name='Win the game') | Q(produces__name='Win the game at the beginning of your next upkeep') + tag_query &= Q(produces__name__in=['Win the game', 'Win the game at the beginning of your next upkeep']) case _: raise NotSupportedError(f'Value {value.value} is not supported for tag search.') if value.prefix == '-':