using data.redirect to set redirect path on success
This commit is contained in:
		
					parent
					
						
							
								f35c3dbc10
							
						
					
				
			
			
				commit
				
					
						42985c28f1
					
				
			
		
					 2 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
					@ -93,14 +93,14 @@ $(document).ready(function() {
 | 
				
			||||||
                    // $('.modal-header > .close').removeClass('hidden');
 | 
					                    // $('.modal-header > .close').removeClass('hidden');
 | 
				
			||||||
                    $('#createvm-modal-title').text(data.msg_title);
 | 
					                    $('#createvm-modal-title').text(data.msg_title);
 | 
				
			||||||
                    $('#createvm-modal-body').text(data.msg_body);
 | 
					                    $('#createvm-modal-body').text(data.msg_body);
 | 
				
			||||||
                    $('#createvm-modal-done-btn').removeClass('hide');
 | 
					                    $('#createvm-modal-done-btn')
 | 
				
			||||||
 | 
					                        .attr('href', data.redirect)
 | 
				
			||||||
 | 
					                        .removeClass('hide');
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            error: function (xmlhttprequest, textstatus, message) {
 | 
					            error: function (xmlhttprequest, textstatus, message) {
 | 
				
			||||||
                    fa_icon = $('.modal-icon > .fa');
 | 
					                    fa_icon = $('.modal-icon > .fa');
 | 
				
			||||||
                    fa_icon.attr('class', 'fa fa-close');
 | 
					                    fa_icon.attr('class', 'fa fa-close');
 | 
				
			||||||
                    // $('.modal-header > .close').attr('class', 'close');
 | 
					 | 
				
			||||||
                    // $('.modal-text').addClass('hide');
 | 
					 | 
				
			||||||
                    if (typeof(create_vm_error_message) !== 'undefined') {
 | 
					                    if (typeof(create_vm_error_message) !== 'undefined') {
 | 
				
			||||||
                        $('#createvm-modal-text').text(create_vm_error_message);
 | 
					                        $('#createvm-modal-text').text(create_vm_error_message);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -804,6 +804,7 @@ class OrdersHostingDetailView(LoginRequiredMixin,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        response = {
 | 
					        response = {
 | 
				
			||||||
            'status': True,
 | 
					            'status': True,
 | 
				
			||||||
 | 
					            'redirect': reverse('hosting:virtual_machines'),
 | 
				
			||||||
            'msg_title': str(_('Thank you for the order.')),
 | 
					            'msg_title': str(_('Thank you for the order.')),
 | 
				
			||||||
            'msg_body': str(_('Your VM will be up and running in a few moments.'
 | 
					            'msg_body': str(_('Your VM will be up and running in a few moments.'
 | 
				
			||||||
                              ' We will send you a confirmation email as soon as'
 | 
					                              ' We will send you a confirmation email as soon as'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue