fix(subscriptions): un abonnement en échec (failed) ne bloque plus le réabonnement

This commit is contained in:
Colin Maudry
2026-07-01 16:56:34 +02:00
parent 872fc33dd7
commit 126834c7d4
2 changed files with 20 additions and 2 deletions
+6 -2
View File
@@ -294,12 +294,16 @@ def _tous_abonnes_banner():
)
def _show_active_view(row) -> bool:
return row is not None and row["status"] != "failed"
def layout(**query):
guard = account_guard("/compte/abonnement", require_subscription=False)
if guard is not None:
return guard
row = db.get_by_user(current_user.id) if current_user.is_authenticated else None
row = db.get_current(current_user.id) if current_user.is_authenticated else None
trial_used = (
db.has_used_trial(current_user.id) if current_user.is_authenticated else False
)
@@ -310,7 +314,7 @@ def layout(**query):
body.append(banner)
body.extend(_feedback(query))
if row is not None:
if _show_active_view(row):
body.append(_active_view(row))
body.append(_resiliation_modal(row["current_period_end"]))
else: