From 1129a4605c0a016c8997f08faf6179489f9bd06a Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Wed, 5 Oct 2016 13:07:44 -0700 Subject: [PATCH] Fixes a bug, hopefully --- registrasion/reporting/views.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/registrasion/reporting/views.py b/registrasion/reporting/views.py index 28dfa037..d5ba66a3 100644 --- a/registrasion/reporting/views.py +++ b/registrasion/reporting/views.py @@ -690,7 +690,7 @@ def speaker_registrations(request, form): kinds = form.cleaned_data["kind"] presentations = schedule_models.Presentation.objects.filter( - proposal_base__kind=kinds, + proposal_base__kind__in=kinds, ).exclude( cancelled=True, ) @@ -702,9 +702,13 @@ def speaker_registrations(request, form): 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.order_by("paid_carts") + users = users.order_by("paid_carts") return QuerysetReport( "Speaker Registration Status",