From cb3ff7310099723b5a9303df1e09494484c8e116 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 25 Mar 2020 18:47:00 +0530 Subject: [PATCH] Filter out None case for discount's name --- datacenterlight/views.py | 1 + hosting/views.py | 1 + 2 files changed, 2 insertions(+) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 233edb20..17a0479f 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -935,6 +935,7 @@ class OrderConfirmationView(DetailView, FormView): [{"plan": stripe_plan.get('response_object').stripe_plan_id}], coupon=(discount['stripe_coupon_id'] if 'name' in discount and + discount['name'] is not None and 'ipv6' in discount['name'].lower() and discount['stripe_coupon_id'] else ""), diff --git a/hosting/views.py b/hosting/views.py index 969523b3..1d16a750 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1187,6 +1187,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView, FormView): [{"plan": stripe_plan.get('response_object').stripe_plan_id}], coupon=(discount['stripe_coupon_id'] if 'name' in discount and + discount['name'] is not None and 'ipv6' in discount['name'].lower() and discount['stripe_coupon_id'] else ""),