From 44d6ace4961b167ce9503f3f5a7299a37f3dc8de Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 13 Nov 2025 16:03:16 -0500 Subject: Simplify Stripe portal error handling and fix account page padding - Remove user-facing error messages for portal configuration - Just log the error server-side and return 500 status - Use Bootstrap card-header class for proper padding on section headers - This fixes icons touching the card borders Portal errors will now be logged but won't break the UI. Amp-Thread-ID: https://ampcode.com/threads/T-8edacbeb-b343-49ca-b524-1c999272acb6 Co-authored-by: Amp --- Biz/PodcastItLater/Billing.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'Biz/PodcastItLater/Billing.py') diff --git a/Biz/PodcastItLater/Billing.py b/Biz/PodcastItLater/Billing.py index bf907bf..9f3739d 100644 --- a/Biz/PodcastItLater/Billing.py +++ b/Biz/PodcastItLater/Billing.py @@ -212,19 +212,10 @@ def create_portal_session(user_id: int, base_url: str) -> str: msg = "User has no Stripe customer ID" raise ValueError(msg) - try: - session = stripe.billing_portal.Session.create( - customer=user["stripe_customer_id"], - return_url=f"{base_url}/account", - ) - except Exception as e: - # Catch Stripe errors (portal not configured, etc.) - logger.exception("Stripe portal error") - msg = ( - "Billing portal not configured. " - "Please contact support or cancel via your account page." - ) - raise ValueError(msg) from e + session = stripe.billing_portal.Session.create( + customer=user["stripe_customer_id"], + return_url=f"{base_url}/account", + ) logger.info( "Created portal session for user %s: %s", -- cgit v1.2.3