fixed all test issues

This commit is contained in:
2025-10-22 08:30:01 +02:00
parent 4eede0c8c0
commit bf4455942b
4 changed files with 33 additions and 294 deletions

View File

@@ -422,7 +422,11 @@ class UserSession(Base, TimestampMixin):
@property
def is_expired(self) -> bool:
"""Check if session has expired."""
return datetime.now(timezone.utc) > self.expires_at
# Ensure expires_at is timezone-aware for comparison
expires_at = self.expires_at
if expires_at.tzinfo is None:
expires_at = expires_at.replace(tzinfo=timezone.utc)
return datetime.now(timezone.utc) > expires_at
def revoke(self) -> None:
"""Revoke this session."""