Filter out None case for discount's name

This commit is contained in:
PCoder 2020-03-25 18:47:00 +05:30
parent 46c33cf107
commit cb3ff73100
2 changed files with 2 additions and 0 deletions

View file

@ -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 ""),

View file

@ -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 ""),