Some more refactoring
This commit is contained in:
parent
3d8f81339b
commit
edac806c11
1 changed files with 5 additions and 4 deletions
|
@ -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")
|
||||||
|
|
Loading…
Reference in a new issue