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

This commit is contained in:
Untone 2023-12-18 00:10:29 +03:00
parent 3cccf97198
commit 844f32f204
2 changed files with 5 additions and 5 deletions

View File

@ -120,7 +120,7 @@ async def load_recipients(_, _info, limit=50, offset=0):
my_followings: List[ChatMember] = await get_my_followed() my_followings: List[ChatMember] = await get_my_followed()
if all_authors: if all_authors:
if len(my_followings) < limit: if len(my_followings) < limit:
my_followings = my_followings + all_authors[0 : limit - len(my_followings)] my_followings = my_followings + list(all_authors)[0 : limit - len(my_followings)]
for a in my_followings: for a in my_followings:
a["online"] = a["id"] in onliners a["online"] = a["id"] in onliners
r.append(a) r.append(a)

View File

@ -1,7 +1,7 @@
from typing import Any, List from typing import Any, List
import aiohttp import aiohttp
from aiohttp import ClientResponse, ClientSession
from models.member import ChatMember from models.member import ChatMember
from settings import API_BASE from settings import API_BASE
@ -53,10 +53,10 @@ async def get_my_followed() -> List[ChatMember]:
"variables": None, "variables": None,
} }
async with aiohttp.ClientSession() as client: async with ClientSession() as client:
try: try:
response = await client.post(API_BASE, headers=headers, json=gql) response: ClientResponse = await client.post(API_BASE, headers=headers, json=gql)
print(f"[services.core] {query_name}: [{response.status_code}] {len(response.text)} bytes") print(f"[services.core] {query_name}: [{response.status}] {len(response.text)} bytes")
if response.status_code != 200: if response.status_code != 200:
return [] return []
r = response.json() r = response.json()