From bb8a0ea1f4bf296c6cf2dfd7a3a87f6396e3586f Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Fri, 13 Dec 2024 16:26:21 +0530 Subject: [PATCH] stripe: Create customer if one doesn't exist. Since this function can only be called by billing admins, it is okay to allow them to create a customer if one doesn't exist. --- corporate/lib/stripe.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index b9102d36fb..b38fe313f9 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -818,12 +818,10 @@ class BillingSession(ABC): setup_payment_by_invoice: bool = False, ) -> str: customer = self.get_customer() - if setup_payment_by_invoice and ( - customer is None or customer.stripe_customer_id is None - ): # nocoverage + if customer is None or customer.stripe_customer_id is None: # nocoverage customer = self.create_stripe_customer() - assert customer is not None and customer.stripe_customer_id is not None + assert customer.stripe_customer_id is not None if return_to_billing_page: return_url = f"{self.billing_session_url}/billing/"