Merge branch 'bugfix/nonetype-in-discount-name' into 'master'

Filter out None case for discount's name

See merge request ungleich-public/dynamicweb!735
This commit is contained in:
pcoder116 2020-03-25 14:23:29 +01:00
commit 1986978f9b
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 ""),