Check card_id also for order confirmation

This commit is contained in:
PCoder 2018-06-12 11:14:36 +02:00
parent 86f0526773
commit 6db38d7e29

View file

@ -945,7 +945,9 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView):
return HttpResponseRedirect(
reverse('hosting:create_virtual_machine')
)
if 'token' not in self.request.session:
if ('token' not in self.request.session and
'card_id' not in self.request.session):
return HttpResponseRedirect(reverse('hosting:payment'))
self.object = self.get_object()
context = self.get_context_data(object=self.object)