author-getting-fix
All checks were successful
deploy / deploy (push) Successful in 1m4s

This commit is contained in:
2023-12-19 17:24:52 +03:00
parent d75f31072c
commit 8c1f52f99b
5 changed files with 67 additions and 55 deletions

View File

@@ -3,6 +3,7 @@ import time
from models.chat import Message
from services.auth import login_required
from services.core import authors_by_user
from services.presence import notify_message
from services.rediscache import redis
from services.schema import mutation
@@ -12,7 +13,10 @@ from services.schema import mutation
@login_required
async def create_message(_, info, chat_id: str, body: str, reply_to=None):
"""Создание сообщения с телом :body для чата :chat_id с возможным ответом на :reply_to"""
author_id = info.context["author_id"]
user_id = info.context["user_id"]
author = authors_by_user[user_id]
author_id = author["id"]
# Получение данных чата из Redis
chat_data = await redis.execute("GET", f"chats/{chat_id}")