allow to disable appcat price calculator
This commit is contained in:
parent
6ad8b9aa49
commit
01d35a461b
5 changed files with 49 additions and 3 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue