Skip to content

Commit

Permalink
Reorder clauses in query
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeluigi committed Jan 7, 2025
1 parent 966568d commit 6740b05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/spellbook/views/find_my_combos.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ def get(self, request: Request) -> Response:
variant_id_list = CardInVariant.objects \
.values('variant_id') \
.alias(
missing_count=Sum(Greatest(F('quantity') - quantity_in_deck, Value(0))),
total_count=Sum('quantity'),
missing_count=Sum(Greatest(F('quantity') - quantity_in_deck, Value(0))),
) \
.filter(
missing_count__lte=1,
total_count__gte=2,
missing_count__lte=1,
)

viewset = VariantViewSet()
Expand Down

0 comments on commit 6740b05

Please sign in to comment.