финальные evidence для lab2 + кэширование

This commit is contained in:
2026-10-01 03:50:54 +03:00
parent 2b90834d03
commit 43e5964180
9 changed files with 371 additions and 7 deletions
+1 -2
View File
@@ -10,7 +10,6 @@ from ..db.models import Chat, ChatMember, User
async def create_atomic(
db: AsyncSession, title: str, member_ids: list[UUID]
) -> Chat:
# проверка всех участников
found = (
(await db.execute(select(User.id).where(User.id.in_(member_ids))))
.scalars()
@@ -22,7 +21,7 @@ async def create_atomic(
chat = Chat(title=title)
db.add(chat)
await db.flush() # получить chat.id
await db.flush()
for uid in member_ids:
db.add(ChatMember(chat_id=chat.id, user_id=uid))