Set respective order_confirm_url for landing vs hosting flows

For hosting flow also take the user to add_ssh_key after payment
This commit is contained in:
PCoder 2019-07-01 20:30:06 +05:30
parent c35bc79c5c
commit c285e1d9eb
2 changed files with 8 additions and 6 deletions

View file

@ -528,8 +528,10 @@ class PaymentOrderView(FormView):
self.request.session['generic_payment_type'] == 'generic'):
return HttpResponseRedirect(
reverse('datacenterlight:order_confirmation'))
return HttpResponseRedirect(
reverse('datacenterlight:add_ssh_key'))
else:
self.request.session['order_confirm_url'] = reverse('datacenterlight:order_confirmation')
return HttpResponseRedirect(
reverse('datacenterlight:add_ssh_key'))
else:
context = self.get_context_data()
context['billing_address_form'] = address_form

View file

@ -769,10 +769,10 @@ class PaymentVMView(LoginRequiredMixin, FormView):
reverse('hosting:payment') + '#payment_error')
request.session['token'] = token
request.session['billing_address_data'] = billing_address_data
return HttpResponseRedirect("{url}?{query_params}".format(
url=reverse('hosting:order-confirmation'),
query_params='page=payment')
)
self.request.session['order_confirm_url'] = "{url}?{query_params}".format(
url=reverse('hosting:order-confirmation'),
query_params='page=payment')
return HttpResponseRedirect(reverse('hosting:add_ssh_key'))
else:
return self.form_invalid(form)