Filter context templates also by the ids that have been set for the calculator
This commit is contained in:
parent
94f520be35
commit
b872777bda
1 changed files with 9 additions and 3 deletions
|
@ -88,6 +88,12 @@ class DCLCalculatorPlugin(CMSPluginBase):
|
|||
context = super(DCLCalculatorPlugin, self).render(
|
||||
context, instance, placeholder
|
||||
)
|
||||
ids = instance.pricing.vm_templates_to_show
|
||||
if ids:
|
||||
context['templates'] = VMTemplate.objects.filter(
|
||||
vm_type=instance.vm_type
|
||||
).filter(opennebula_vm_template_id__in=ids)
|
||||
else:
|
||||
context['templates'] = VMTemplate.objects.filter(
|
||||
vm_type=instance.vm_type
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue