added vm_template parameter to djangohosting view

This commit is contained in:
Levi 2017-04-29 12:46:56 -05:00
parent 085133fb53
commit 3e755b3b68
2 changed files with 8 additions and 7 deletions

View file

@ -24,6 +24,7 @@
{% csrf_token %}
<input type="hidden" name="hosting_company" value="{{vm.hosting_company}}">
<input type="hidden" name="location_code" value="{{vm.location_code}}">
<input type="hidden" name="vm_template" value="1">

View file

@ -310,17 +310,17 @@ class PaymentVMView(LoginRequiredMixin, FormView):
order.set_approved()
# Create VM using oppenebula functions
_request = namedtuple('request', 'POST user')
_request.user = request.user
# _request = namedtuple('request', 'POST user')
# _request.user = request.user
# user = namedtuple('user', 'email')
# email
_request.POST = {
'vm_template': vm_template
}
# _request.POST = {
# 'vm_template': vm_template
# }
hosting_admin = HostingManageVMAdmin.__new__(HostingManageVMAdmin)
hosting_admin.init_opennebula_client(_request)
hosting_admin.create(_request)
hosting_admin.init_opennebula_client(request)
hosting_admin.create(request)
# Send notification to ungleich as soon as VM has been booked
context = {