feat: update datetime handling to use UTC and improve type annotations

This commit is contained in:
gabdevele
2026-04-12 20:25:30 +02:00 Unverified
parent cc8ae34838
commit 0ea45364bf
5 changed files with 26 additions and 15 deletions
+4 -3
View File
@@ -1,5 +1,6 @@
from datetime import datetime, timezone
from typing import Any, Mapping
from collections.abc import Mapping
from datetime import UTC, datetime
from typing import Any
from core.mongodb import get_database
from models.auth import AuthUserDocument
@@ -10,7 +11,7 @@ REVOKED_COLLECTION_NAME = "revoked_tokens"
def utcnow() -> datetime:
return datetime.now(timezone.utc)
return datetime.now(UTC)
async def users_collection() -> AsyncIOMotorCollection[dict[str, Any]]:
+4 -3
View File
@@ -1,5 +1,6 @@
from datetime import datetime, timezone
from typing import Any, Mapping
from collections.abc import Mapping
from datetime import UTC, datetime
from typing import Any
from core.mongodb import get_database
from models.proxy import ProxyDocument, ProxyUpdateInput
@@ -12,7 +13,7 @@ COLLECTION_NAME = "proxies"
def _utcnow() -> datetime:
return datetime.now(timezone.utc)
return datetime.now(UTC)
async def _collection() -> AsyncIOMotorCollection[dict[str, Any]]: