From 74425add85864a2b95ffdfec99adf357c8137ee2 Mon Sep 17 00:00:00 2001 From: rizwanisready Date: Fri, 2 Aug 2024 16:20:04 +0530 Subject: [PATCH] auto recurring testing phase 22 --- manage_subscriptions/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manage_subscriptions/views.py b/manage_subscriptions/views.py index 163c283..5575340 100644 --- a/manage_subscriptions/views.py +++ b/manage_subscriptions/views.py @@ -119,9 +119,9 @@ class SubscriptionCreateOrUpdateView(LoginRequiredMixin, generic.View): def handle_stripe_price(self, form): try: stripe.api_key = settings.STRIPE_SECRET_KEY - + stripe_product_id = form.instance.stripe_product.product_id if form.instance.stripe_product else None # creating Stripe price only if the subscription is not free - if not form.cleaned_data.get("is_free"): + if not form.cleaned_data.get("is_free") and stripe_product_id: # Getting Stripe Product ID stripe_product = form.instance.stripe_product plan = form.instance.plan