format+fix-5
All checks were successful
deploy / deploy (push) Successful in 1m16s

This commit is contained in:
Untone 2023-11-14 21:43:41 +03:00
parent 35ad683579
commit 435a00b558

View File

@ -24,7 +24,7 @@ async def get_all_authors():
import traceback
traceback.print_exc()
print(f"[services.core] {query_name}: {response.status_code} {len(response.text)} bytes")
print(f"[services.core] {query_name}: [{response.status_code}] {len(response.text)} bytes")
if response.status_code != 200:
return None
r = response.json()
@ -50,9 +50,13 @@ async def get_my_followings():
import traceback
traceback.print_exc()
print(f"[services.core] {query_name}: {response.status_code} {len(response.text)} bytes")
print(f"[services.core] {query_name}: [{response.status_code}] {len(response.text)} bytes")
if response.status_code != 200:
return None
r = response.json()
authors = r.get("data", {}).get(query_name, {}).get("authors", [])
return authors
data = r.get("data")
if data:
authors = data.get(query_name, {}).get("authors", [])
return authors
else:
return []