diff options
Diffstat (limited to 'Biz/PodcastItLater/Web.py')
| -rw-r--r-- | Biz/PodcastItLater/Web.py | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/Biz/PodcastItLater/Web.py b/Biz/PodcastItLater/Web.py index c2f957a..9fe328b 100644 --- a/Biz/PodcastItLater/Web.py +++ b/Biz/PodcastItLater/Web.py @@ -1079,9 +1079,6 @@ def account_page(request: Request) -> html.html | RedirectResponse: subscription_status = user.get("subscription_status", "") cancel_at_period_end = user.get("cancel_at_period_end", 0) == 1 - # Get error message from query params - error_message = request.query_params.get("error") - return html.html( html.head( html.meta(charset="utf-8"), @@ -1131,34 +1128,12 @@ def account_page(request: Request) -> html.html | RedirectResponse: ], ), ), - # Error alert - html.div( - html.div( - html.i( - classes=[ - "bi", - "bi-exclamation-triangle-fill", - "me-2", - ], - ), - error_message or "", - classes=[ - "alert", - "alert-danger", - "d-flex", - "align-items-center", - ], - role="alert", # type: ignore[call-arg] - ), - ) - if error_message - else html.div(), # Account info section html.div( html.h4( html.i(classes=["bi", "bi-envelope-fill", "me-2"]), "Account Information", - classes=["mb-3"], + classes=["card-header", "bg-transparent"], ), html.div( html.div( @@ -1182,7 +1157,7 @@ def account_page(request: Request) -> html.html | RedirectResponse: classes=["bi", "bi-credit-card-fill", "me-2"], ), "Subscription", - classes=["mb-3"], + classes=["card-header", "bg-transparent"], ), html.div( html.div( @@ -1272,7 +1247,7 @@ def account_page(request: Request) -> html.html | RedirectResponse: html.h4( html.i(classes=["bi", "bi-sliders", "me-2"]), "Actions", - classes=["mb-3"], + classes=["card-header", "bg-transparent"], ), html.div( html.a( @@ -1532,14 +1507,9 @@ def billing_portal(request: Request) -> Response | RedirectResponse: try: portal_url = Billing.create_portal_session(user_id, BASE_URL) return RedirectResponse(url=portal_url, status_code=303) - except ValueError as e: - logger.exception("Portal error") - # Redirect back to account page with error message - error_msg = str(e) - return RedirectResponse( - url=f"/account?error={urllib.parse.quote(error_msg)}", - status_code=303, - ) + except Exception: + logger.exception("Portal error - ensure Stripe portal is configured") + return Response("Portal not configured", status_code=500) @app.post("/stripe/webhook") |
