Some more refactoring

This commit is contained in:
PCoder 2017-10-29 21:56:29 +01:00
parent 3d8f81339b
commit edac806c11

View file

@ -785,17 +785,18 @@ class OrderConfirmationView(DetailView):
['specs', 'template', 'billing_address', 'billing_address_data', ['specs', 'template', 'billing_address', 'billing_address_data',
'token', 'customer'] 'token', 'customer']
) )
if request.user.is_authenticated():
redirect_url = reverse('hosting:virtual_machines')
else:
redirect_url = reverse('datacenterlight:index')
response = { response = {
'status': True, 'status': True,
'redirect': reverse( 'redirect': redirect_url,
'hosting:virtual_machines') if request.user.is_authenticated() else reverse(
'datacenterlight:index'),
'msg_title': str(_('Thank you for the order.')), 'msg_title': str(_('Thank you for the order.')),
'msg_body': str( 'msg_body': str(
_('Your VM will be up and running in a few moments.' _('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'
' it is ready.')) ' it is ready.'))
} }
return HttpResponse(json.dumps(response), return HttpResponse(json.dumps(response),
content_type="application/json") content_type="application/json")