feat: completed tasks for grade 4
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-11-22 14:40:35 +03:00
parent 0b97f77d76
commit e0263ba902
42 changed files with 5257 additions and 523 deletions
+11 -1
View File
@@ -1,7 +1,7 @@
from collections.abc import Collection
from uuid import UUID
from sqlalchemy import select
from sqlalchemy import select, update
from sqlalchemy.ext.asyncio import AsyncSession
from app.models.user import User
@@ -45,3 +45,13 @@ async def get_existing_user_ids(
result = await session.execute(stmt)
existing_ids = set(result.scalars().all())
return existing_ids
async def replace_password_hash(
session: AsyncSession, user_id: UUID, previous: str, replacement: str
) -> None:
await session.execute(
update(User)
.where(User.id == user_id, User.password_hash == previous)
.values(password_hash=replacement)
)