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:
Deeman
2026-02-21 00:02:41 +01:00
parent 88e408b279
commit 4dcf1e7e84
3 changed files with 64 additions and 33 deletions

View File

@@ -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:

View File

@@ -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>