From 481f13d20c088d73eee221a98b411504a02430d0 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 24 Sep 2018 22:27:25 +0200 Subject: [PATCH] Check key existence --- datacenterlight/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 8e7b4b84..18766d88 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -596,7 +596,7 @@ class OrderConfirmationView(DetailView): if ('generic_payment_type' not in request.session or (request.session['generic_payment_details']['recurring'])): - if request.session['generic_payment_details']['recurring']: + if 'generic_payment_details' in request.session: amount_to_be_charged = ( round( request.session['generic_payment_details']['amount'], @@ -731,7 +731,6 @@ class OrderConfirmationView(DetailView): }) if 'generic_payment_type' in request.session: - stripe_cus = StripeCustomer.objects.filter( stripe_id=stripe_api_cus_id ).first()