cleaned code
This commit is contained in:
		
					parent
					
						
							
								8980f6b2fc
							
						
					
				
			
			
				commit
				
					
						07dc04018f
					
				
			
		
					 3 changed files with 44 additions and 28 deletions
				
			
		|  | @ -1,19 +1,19 @@ | |||
| from django.shortcuts import redirect | ||||
| from django.core.urlresolvers import reverse | ||||
| 
 | ||||
| from opennebula_api.serializers import VirtualMachineTemplateSerializer | ||||
| from opennebula_api.models import OpenNebulaManager | ||||
| 
 | ||||
| 
 | ||||
| class ProcessVMSelectionMixin(object): | ||||
| 
 | ||||
|     def post(self, request, *args, **kwargs): | ||||
|         #configuration = request.POST.get('configuration') | ||||
|         #configuration_display = dict(VirtualMachinePlan.VM_CONFIGURATION).get(configuration) | ||||
|         vm_template_id = request.POST.get('vm_template_id') | ||||
|         vm_specs.update({ | ||||
|             'configuration_display': configuration_display, | ||||
|             'configuration': configuration, | ||||
|             'vm_template_id': vm_template_id | ||||
|         }) | ||||
|         request.session['vm_specs'] = vm_specs | ||||
| 
 | ||||
|         template_id = int(request.POST.get('vm_template_id')) | ||||
|         template = OpenNebulaManager().get_template(template_id) | ||||
|         data = VirtualMachineTemplateSerializer(template).data | ||||
|         request.session['template'] = data | ||||
| 
 | ||||
|         if not request.user.is_authenticated(): | ||||
|             request.session['next'] = reverse('hosting:payment') | ||||
|             return redirect(reverse('hosting:login')) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue