Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stripe: Create customer if one doesn't exist.

Aman Agrawalbb8a0ea1f4bf
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py
index b9102d36fb7..b38fe313f99 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/"