diff --git a/pinaxcon/templates/registrasion/discount_list.html b/pinaxcon/templates/registrasion/discount_list.html index 521794c8f65a2aad6eb230ea652e961c3417ec01..b2836f5296714f62f530d6c436cea74385e5d70e 100644 --- a/pinaxcon/templates/registrasion/discount_list.html +++ b/pinaxcon/templates/registrasion/discount_list.html @@ -1,6 +1,6 @@ {% if discounts %}
-

Discounts and Complimentary Items

+

Discounts and Complimentary Items

The following discounts and complimentary items are available to you. If you wish to take advantage of this offer, you must choose your items below. The discounts will be applied automatically when you check out.

{% regroup discounts by discount.description as discounts_grouped %} {% for discount_type in discounts_grouped %} diff --git a/vendor/registrasion/registrasion/views.py b/vendor/registrasion/registrasion/views.py index a6c7a2c4b1845990db0a645bbbdc0be4a78fae02..fddbc0c861c81f97258104c5fc424bbb0593ee13 100644 --- a/vendor/registrasion/registrasion/views.py +++ b/vendor/registrasion/registrasion/views.py @@ -1,3 +1,4 @@ +from collections import defaultdict import datetime import zipfile import os @@ -291,21 +292,22 @@ def _guided_registration_products(request, mode): seen_categories = [] with BatchController.batch(request.user): - available_products = list(ProductController.available_products( + available_products = ProductController.available_products( request.user, products=all_products, - )) + ) if len(available_products) == 0: return [] + available_by_category = defaultdict(list) + for product in available_products: + available_by_category[product.category].append(product) + has_errors = False for category in cats: - products = [ - i for i in available_products - if i.category == category - ] + products = available_by_category[category] prefix = "category_" + str(category.id) p = _handle_products(request, category, products, prefix)