From 6db38d7e292959bfef78355225d3ef39144f8bcb Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 12 Jun 2018 11:14:36 +0200 Subject: [PATCH] Check card_id also for order confirmation --- hosting/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index b63bae9f..47ed44a7 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -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)