author-id-fix
All checks were successful
deploy / deploy (push) Successful in 1m13s

This commit is contained in:
2023-11-28 12:05:39 +03:00
parent 15139249f1
commit c53b7a4c6c
7 changed files with 64 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
import json
import uuid
from datetime import datetime, timezone
import time
from services.auth import login_required
from services.rediscache import redis
@@ -32,7 +32,7 @@ async def update_chat(_, info, chat_new: ChatUpdate):
{
"title": chat_new.get("title", chat["title"]),
"description": chat_new.get("description", chat["description"]),
"updated_at": int(datetime.now(tz=timezone.utc).timestamp()),
"updated_at": int(time.time()),
"admins": chat_new.get("admins", chat.get("admins") or []),
"members": chat_new.get("members", chat["members"]),
}
@@ -75,8 +75,8 @@ async def create_chat(_, info, title="", members=None):
"title": title,
"description": "",
"created_by": author_id,
"created_at": int(datetime.now(tz=timezone.utc).timestamp()),
"updated_at": int(datetime.now(tz=timezone.utc).timestamp()),
"created_at": int(time.time()),
"updated_at": int(time.time()),
"admins": members if (len(members) == 2 and title == "") else [],
}