using data.redirect to set redirect path on success

This commit is contained in:
Arvind Tiwari 2017-09-26 22:58:56 +05:30
parent f35c3dbc10
commit 42985c28f1
2 changed files with 4 additions and 3 deletions

View file

@ -93,14 +93,14 @@ $(document).ready(function() {
// $('.modal-header > .close').removeClass('hidden');
$('#createvm-modal-title').text(data.msg_title);
$('#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) {
fa_icon = $('.modal-icon > .fa');
fa_icon.attr('class', 'fa fa-close');
// $('.modal-header > .close').attr('class', 'close');
// $('.modal-text').addClass('hide');
if (typeof(create_vm_error_message) !== 'undefined') {
$('#createvm-modal-text').text(create_vm_error_message);
}

View file

@ -804,6 +804,7 @@ class OrdersHostingDetailView(LoginRequiredMixin,
response = {
'status': True,
'redirect': reverse('hosting:virtual_machines'),
'msg_title': str(_('Thank you for the order.')),
'msg_body': str(_('Your VM will be up and running in a few moments.'
' We will send you a confirmation email as soon as'