Fixed djangohosting, railshosting and nodehosting page. Fixed payment erro
This commit is contained in:
		
					parent
					
						
							
								1aba5cbee5
							
						
					
				
			
			
				commit
				
					
						3f198bb4de
					
				
			
		
					 5 changed files with 36 additions and 16 deletions
				
			
		|  | @ -4,15 +4,21 @@ from django.core.urlresolvers import reverse | |||
| from opennebula_api.serializers import VirtualMachineTemplateSerializer | ||||
| from opennebula_api.models import OpenNebulaManager | ||||
| 
 | ||||
| from .models import HostingPlan | ||||
| 
 | ||||
| 
 | ||||
| class ProcessVMSelectionMixin(object): | ||||
| 
 | ||||
|     def post(self, request, *args, **kwargs): | ||||
| 
 | ||||
|         template_id = int(request.POST.get('vm_template_id')) | ||||
|         configuration_id = int(request.POST.get('configuration')) | ||||
|         template = OpenNebulaManager().get_template(template_id) | ||||
|         data = VirtualMachineTemplateSerializer(template).data | ||||
|         configuration = HostingPlan.objects.get(id=configuration_id) | ||||
| 
 | ||||
|         request.session['template'] = data | ||||
|         request.session['specs'] = configuration.serialize() | ||||
| 
 | ||||
|         if not request.user.is_authenticated(): | ||||
|             request.session['next'] = reverse('hosting:payment') | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue