decode-json-fix

This commit is contained in:
tonyrewin 2022-11-11 09:58:40 +03:00
parent 0b7adfb0eb
commit e2001a7f3f

View File

@ -34,6 +34,8 @@ async def add_user_to_chat(user_slug: str, chat_id: str, chat=None):
chats_ids = await redis.execute("GET", f"chats_by_user/{user_slug}")
if not chat:
chat = await redis.execute("GET", f"chats/{chat_id}")
if chat:
chat = await json.loads(chat)
if chats_ids:
chats_ids = list(json.loads(chats_ids))
else: