allow to disable appcat price calculator
All checks were successful
Build and Deploy / build (push) Successful in 1m5s
Build and Deploy / deploy (push) Successful in 5s

This commit is contained in:
Tobias Brunner 2025-06-04 17:54:33 +02:00
parent 6ad8b9aa49
commit 01d35a461b
No known key found for this signature in database
5 changed files with 49 additions and 3 deletions

View file

@ -113,14 +113,26 @@ def offering_detail(request, provider_slug, service_slug):
return generate_exoscale_marketplace_yaml(offering)
pricing_data_by_group_and_service_level = None
price_calculator_enabled = False
# Generate pricing data for VSHN offerings
if offering.msp == "VS":
pricing_data_by_group_and_service_level = generate_pricing_data(offering)
try:
appcat_price = offering.service.vshn_appcat_price.get()
price_calculator_enabled = appcat_price.public_display_enabled
# Only generate pricing data if public display is enabled
if price_calculator_enabled:
pricing_data_by_group_and_service_level = generate_pricing_data(
offering
)
except VSHNAppCatPrice.DoesNotExist:
pass
context = {
"offering": offering,
"pricing_data_by_group_and_service_level": pricing_data_by_group_and_service_level,
"price_calculator_enabled": price_calculator_enabled,
}
return render(request, "services/offering_detail.html", context)