From f85ef714abf217fedca458537ce79d3404fcc4a5 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 1 Oct 2018 07:50:15 +0200 Subject: [PATCH] Pass instance context Also POST plugin_id as a form parameter to check enable_512mb_ram case --- datacenterlight/cms_plugins.py | 4 +--- .../templates/datacenterlight/includes/_calculator_form.html | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/datacenterlight/cms_plugins.py b/datacenterlight/cms_plugins.py index af32e64f..ebd4fb8d 100644 --- a/datacenterlight/cms_plugins.py +++ b/datacenterlight/cms_plugins.py @@ -97,9 +97,7 @@ class DCLCalculatorPlugin(CMSPluginBase): context['templates'] = VMTemplate.objects.filter( vm_type=instance.vm_type ).order_by('name') - context['default_selected_template'] = ( - instance.default_selected_template - ) + context['instance'] = instance context['min_ram'] = 0.5 if instance.enable_512mb_ram else 1 return context diff --git a/datacenterlight/templates/datacenterlight/includes/_calculator_form.html b/datacenterlight/templates/datacenterlight/includes/_calculator_form.html index f7deb13f..0b73c83f 100644 --- a/datacenterlight/templates/datacenterlight/includes/_calculator_form.html +++ b/datacenterlight/templates/datacenterlight/includes/_calculator_form.html @@ -15,6 +15,7 @@
{% csrf_token %} +

{% trans "VM hosting" %}

@@ -93,11 +94,11 @@ -
\ No newline at end of file +