discount_details URL parameter for pricelist

This commit is contained in:
Tobias Brunner 2025-05-23 17:12:05 +02:00
parent 19b36b9a2c
commit 5b4392f838
No known key found for this signature in database
2 changed files with 11 additions and 1 deletions

View file

@ -12,6 +12,9 @@ def natural_sort_key(name):
def pricelist(request):
"""Generate comprehensive price list grouped by compute plan groups and service levels"""
# Check if discount details should be shown
show_discount_details = request.GET.get("discount_details", "").lower() == "true"
# Fetch all active compute plans with related data
compute_plans = (
ComputePlan.objects.filter(active=True)
@ -223,5 +226,8 @@ def pricelist(request):
for sl_key, plans_list in service_levels_dict.items()
}
context = {"pricing_data_by_group_and_service_level": final_context_data}
context = {
"pricing_data_by_group_and_service_level": final_context_data,
"show_discount_details": show_discount_details,
}
return render(request, "services/pricelist.html", context)