Fixes a bug, hopefully
This commit is contained in:
parent
36d658e57f
commit
1129a4605c
1 changed files with 7 additions and 3 deletions
|
@ -690,7 +690,7 @@ def speaker_registrations(request, form):
|
||||||
kinds = form.cleaned_data["kind"]
|
kinds = form.cleaned_data["kind"]
|
||||||
|
|
||||||
presentations = schedule_models.Presentation.objects.filter(
|
presentations = schedule_models.Presentation.objects.filter(
|
||||||
proposal_base__kind=kinds,
|
proposal_base__kind__in=kinds,
|
||||||
).exclude(
|
).exclude(
|
||||||
cancelled=True,
|
cancelled=True,
|
||||||
)
|
)
|
||||||
|
@ -702,7 +702,11 @@ def speaker_registrations(request, form):
|
||||||
|
|
||||||
paid_carts = commerce.Cart.objects.filter(status=commerce.Cart.STATUS_PAID)
|
paid_carts = commerce.Cart.objects.filter(status=commerce.Cart.STATUS_PAID)
|
||||||
|
|
||||||
paid_carts = Case(When(cart__in=paid_carts, then=Value(1)), default=Value(0), output_field=models.IntegerField())
|
paid_carts = Case(
|
||||||
|
When(cart__in=paid_carts, then=Value(1)),
|
||||||
|
default=Value(0),
|
||||||
|
output_field=models.IntegerField(),
|
||||||
|
)
|
||||||
users = users.annotate(paid_carts=Sum(paid_carts))
|
users = users.annotate(paid_carts=Sum(paid_carts))
|
||||||
users = users.order_by("paid_carts")
|
users = users.order_by("paid_carts")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue