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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user