fix: normalize unicode escape sequences and reformat multi-line expressions across codebase
This commit is contained in:
@@ -3,7 +3,13 @@ from datetime import datetime, timezone
|
||||
from fastapi import APIRouter, Request
|
||||
from fastapi.responses import RedirectResponse
|
||||
from devplacepy.database import get_table
|
||||
from devplacepy.utils import generate_uid, require_user, create_notification, award_rewards, XP_FOLLOW
|
||||
from devplacepy.utils import (
|
||||
generate_uid,
|
||||
require_user,
|
||||
create_notification,
|
||||
award_rewards,
|
||||
XP_FOLLOW,
|
||||
)
|
||||
from devplacepy.responses import action_result
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -23,14 +29,22 @@ async def follow_user(request: Request, username: str):
|
||||
if existing:
|
||||
return action_result(request, f"/profile/{username}")
|
||||
|
||||
follows.insert({
|
||||
"uid": generate_uid(),
|
||||
"follower_uid": user["uid"],
|
||||
"following_uid": target["uid"],
|
||||
"created_at": datetime.now(timezone.utc).isoformat(),
|
||||
})
|
||||
follows.insert(
|
||||
{
|
||||
"uid": generate_uid(),
|
||||
"follower_uid": user["uid"],
|
||||
"following_uid": target["uid"],
|
||||
"created_at": datetime.now(timezone.utc).isoformat(),
|
||||
}
|
||||
)
|
||||
|
||||
create_notification(target["uid"], "follow", f"{user['username']} started following you", user["uid"], f"/profile/{user['username']}")
|
||||
create_notification(
|
||||
target["uid"],
|
||||
"follow",
|
||||
f"{user['username']} started following you",
|
||||
user["uid"],
|
||||
f"/profile/{user['username']}",
|
||||
)
|
||||
award_rewards(target["uid"], XP_FOLLOW)
|
||||
|
||||
logger.info(f"{user['username']} followed {username}")
|
||||
|
||||
Reference in New Issue
Block a user