fix: replace deprecated datetime.utcnow with timezone-aware datetime.now in all modules and fix comment count query column name

This commit is contained in:
2026-05-14 02:12:19 +00:00
parent cb0fccb270
commit 34cae11630
25 changed files with 82 additions and 385 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import logging
from datetime import datetime
from datetime import datetime, timezone
from fastapi import APIRouter, Request
from fastapi.responses import RedirectResponse
from devplacepy.database import get_table
@@ -26,7 +26,7 @@ async def follow_user(request: Request, username: str):
"uid": generate_uid(),
"follower_uid": user["uid"],
"following_uid": target["uid"],
"created_at": datetime.utcnow().isoformat(),
"created_at": datetime.now(timezone.utc).isoformat(),
})
notifications = get_table("notifications")
@@ -37,7 +37,7 @@ async def follow_user(request: Request, username: str):
"message": f"{user['username']} started following you",
"related_uid": user["uid"],
"read": False,
"created_at": datetime.utcnow().isoformat(),
"created_at": datetime.now(timezone.utc).isoformat(),
})
logger.info(f"{user['username']} followed {username}")