dcl form added

This commit is contained in:
Arvind Tiwari 2017-09-26 03:18:19 +05:30
commit 3c32abbf8e
3 changed files with 17 additions and 8 deletions

View file

@ -2,4 +2,11 @@
{% block navbar %}
{% include "datacenterlight/includes/_navbar.html" %}
{% endblock navbar %}
{% endblock navbar %}
{% block submit_btn %}
<form action="" method="POST">
{% csrf_token %}
<button type="submit" class="btn choice-btn">{% trans "Place order" %}</button>
</form>
{% endblock submit_btn %}

View file

@ -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()