precache-fix
All checks were successful
deploy / deploy (push) Successful in 1m5s

This commit is contained in:
2023-12-19 18:13:37 +03:00
parent 531eb1f028
commit 95a237f349
8 changed files with 21 additions and 29 deletions

View File

@@ -21,9 +21,7 @@ async def update_chat(_, info, chat_new: ChatUpdate):
:param chat_new: dict with chat data
:return: Result { error chat }
"""
user_id = info.context["user_id"]
author = authors_by_user[user_id]
author_id = author["id"]
author_id = info.context["author_id"]
chat_id = chat_new["id"]
chat_str = await redis.execute("GET", f"chats/{chat_id}")
if not chat_str:
@@ -57,6 +55,7 @@ async def create_chat(_, info, title="", members=None):
user_id = info.context["user_id"]
author = authors_by_user[user_id]
author_id = author["id"]
chat = None
if author_id:
if author_id not in members:
members.append(int(author_id))
@@ -101,9 +100,7 @@ async def create_chat(_, info, title="", members=None):
@mutation.field("delete_chat")
@login_required
async def delete_chat(_, info, chat_id: str):
user_id = info.context["user_id"]
author = authors_by_user[user_id]
author_id = author["id"]
author_id = info.context["author_id"]
chat_str = await redis.execute("GET", f"chats/{chat_id}")
if chat_str:
chat: Chat = json.loads(chat_str)