Fixed getting template name from template id

This commit is contained in:
M.Ravi 2017-06-06 03:43:50 +05:30
commit f4a81e9096
8 changed files with 361 additions and 118 deletions

View file

@ -16,6 +16,9 @@ from opennebula_api.serializers import VirtualMachineTemplateSerializer
class LandingProgramView(TemplateView):
template_name = "datacenterlight/landing.html"
class SuccessView(TemplateView):
template_name = "datacenterlight/success.html"
class PricingView(TemplateView):
template_name = "datacenterlight/pricing.html"
@ -47,7 +50,8 @@ class PricingView(TemplateView):
price = request.POST.get('total')
template_id = int(request.POST.get('config'))
manager = OpenNebulaManager()
vm_template_name = (manager.get_template(template_id)).get_name()
template = manager.get_template(template_id)
template_data = VirtualMachineTemplateSerializer(template).data
name = request.POST.get('name')
email = request.POST.get('email')
@ -85,7 +89,7 @@ class PricingView(TemplateView):
'memory': memory,
'storage': storage,
'price': price,
'template': vm_template_name,
'template': template_data['name'],
}
email_data = {
'subject': 'New Order Received',