From 3c32abbf8ed7f67e867ebc9c07fd1bbb2a1ec516 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Tue, 26 Sep 2017 03:18:19 +0530 Subject: [PATCH] dcl form added --- .../templates/datacenterlight/order_detail.html | 9 ++++++++- datacenterlight/views.py | 8 ++++---- hosting/templates/hosting/order_detail.html | 8 +++++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 435c9534..8a51337e 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -2,4 +2,11 @@ {% block navbar %} {% include "datacenterlight/includes/_navbar.html" %} -{% endblock navbar %} \ No newline at end of file +{% endblock navbar %} + +{% block submit_btn %} +
+ {% csrf_token %} + +
+{% endblock submit_btn %} \ No newline at end of file diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 2b31debd..26b8abff 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -484,10 +484,10 @@ class OrderConfirmationView(DetailView): @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): - # if 'specs' not in request.session or 'user' not in request.session: - # return HttpResponseRedirect(reverse('datacenterlight:index')) - # if 'token' not in request.session: - # return HttpResponseRedirect(reverse('datacenterlight:payment')) + if 'specs' not in request.session or 'user' not in request.session: + return HttpResponseRedirect(reverse('datacenterlight:index')) + if 'token' not in request.session: + return HttpResponseRedirect(reverse('datacenterlight:payment')) stripe_customer_id = request.session.get('customer') customer = StripeCustomer.objects.filter(id=stripe_customer_id).first() stripe_utils = StripeUtils() diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index e9cd3f99..b332c5c1 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -139,9 +139,11 @@
{% blocktrans with vm_price=request.session.specs.price %}By clicking "Place order" this plan will charge your credit card account with the fee of {{ vm_price }}CHF/month{% endblocktrans %}.
- + {% block submit_btn %} + + {% endblock submit_btn %}