Fix dashboard error handling, settings billing route, update vision.md
- routes.py: return_exceptions=True on gather, log individual query failures with per-result defaults so one bad query doesn't blank the whole page - settings.html: fix billing.portal → billing.manage (correct blueprint route) - vision.md: update current state to February 2026, document shipped features Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import secrets
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from quart import Blueprint, flash, g, jsonify, redirect, render_template, request, url_for
|
||||
from quart import Blueprint, current_app, flash, g, jsonify, redirect, render_template, request, url_for
|
||||
|
||||
from .. import analytics
|
||||
from ..auth.routes import login_required, update_user
|
||||
@@ -113,8 +113,11 @@ async def index():
|
||||
analytics.get_cot_index_trend(analytics.COFFEE_CFTC_CODE, weeks=104),
|
||||
return_exceptions=True,
|
||||
)
|
||||
defaults = [[], [], [], [], [], None, []]
|
||||
time_series, top_producers, stu_trend, balance, yoy, cot_latest, cot_trend = [
|
||||
r if not isinstance(r, Exception) else (None if i == 5 else [])
|
||||
r if not isinstance(r, Exception) else (
|
||||
current_app.logger.warning("Analytics query %d failed: %s", i, r) or defaults[i]
|
||||
)
|
||||
for i, r in enumerate(results)
|
||||
]
|
||||
else:
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<div>
|
||||
{% if subscription %}
|
||||
<form method="post" action="{{ url_for('billing.portal') }}" class="inline">
|
||||
<form method="post" action="{{ url_for('billing.manage') }}" class="inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn-secondary">Manage Subscription</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user