2016-04-22 13:36:38 +00:00
|
|
|
from django.shortcuts import redirect
|
|
|
|
from django.core.urlresolvers import reverse
|
|
|
|
|
|
|
|
|
|
|
|
class ProcessVMSelectionMixin(object):
|
|
|
|
|
|
|
|
def post(self, request, *args, **kwargs):
|
2017-05-12 10:07:05 +00:00
|
|
|
#configuration = request.POST.get('configuration')
|
|
|
|
#configuration_display = dict(VirtualMachinePlan.VM_CONFIGURATION).get(configuration)
|
|
|
|
vm_template_id = request.POST.get('vm_template_id')
|
2017-05-04 04:19:32 +00:00
|
|
|
vm_specs.update({
|
|
|
|
'configuration_display': configuration_display,
|
|
|
|
'configuration': configuration,
|
2017-05-12 10:07:05 +00:00
|
|
|
'vm_template_id': vm_template_id
|
2017-05-04 04:19:32 +00:00
|
|
|
})
|
2016-04-22 13:36:38 +00:00
|
|
|
request.session['vm_specs'] = vm_specs
|
|
|
|
if not request.user.is_authenticated():
|
2016-04-30 18:55:55 +00:00
|
|
|
request.session['next'] = reverse('hosting:payment')
|
2016-04-22 13:36:38 +00:00
|
|
|
return redirect(reverse('hosting:login'))
|
|
|
|
return redirect(reverse('hosting:payment'))
|