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,6 +528,8 @@ class PaymentOrderView(FormView):
self.request.session['generic_payment_type'] == 'generic'): self.request.session['generic_payment_type'] == 'generic'):
return HttpResponseRedirect( return HttpResponseRedirect(
reverse('datacenterlight:order_confirmation')) reverse('datacenterlight:order_confirmation'))
else:
self.request.session['order_confirm_url'] = reverse('datacenterlight:order_confirmation')
return HttpResponseRedirect( return HttpResponseRedirect(
reverse('datacenterlight:add_ssh_key')) reverse('datacenterlight:add_ssh_key'))
else: else:

View file

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