diff --git a/registrasion/reporting/forms.py b/registrasion/reporting/forms.py index a02d96e0..e9f8cf0a 100644 --- a/registrasion/reporting/forms.py +++ b/registrasion/reporting/forms.py @@ -24,7 +24,7 @@ class DiscountForm(forms.Form): class ProductAndCategoryForm(forms.Form): product = forms.ModelMultipleChoiceField( - queryset=inventory.Product.objects.all(), + queryset=inventory.Product.objects.select_related("category"), required=False, ) category = forms.ModelMultipleChoiceField( diff --git a/registrasion/reporting/views.py b/registrasion/reporting/views.py index deda9bf1..5d25adc8 100644 --- a/registrasion/reporting/views.py +++ b/registrasion/reporting/views.py @@ -543,7 +543,7 @@ def attendee_data(request, form, user_id=None): ).exclude( cart__status=commerce.Cart.STATUS_RELEASED ).select_related( - "cart", "product" + "cart", "cart__user", "product", "product__category", ).order_by("cart__status") # Get all of the relevant attendee profiles in one hit.