fix(abonnement): garde active→pending, datetime parse, resolve_handle vide (#90)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DRGb8NAMwaTZxUszSbaj4N
This commit is contained in:
Colin Maudry
2026-06-25 19:26:15 +02:00
parent d3025e323b
commit 5f500a1aa8
6 changed files with 96 additions and 4 deletions
+7 -1
View File
@@ -102,7 +102,13 @@ def has_active_subscription(user_id: int) -> bool:
if row["status"] in _ACCESS_STATUSES:
return True
if row["status"] == "cancelled" and row["current_period_end"]:
return row["current_period_end"] > _now()
try:
end = datetime.fromisoformat(
row["current_period_end"].replace("Z", "+00:00")
)
return end > datetime.now(timezone.utc)
except ValueError:
return False
return False