From 636b5446a2056ac5ed3412b89fd53b1e4343eb26 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 24 Jan 2024 12:22:05 +0300 Subject: [PATCH] cache-authors-fix --- services/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core.py b/services/core.py index 4747a2e..3eda1f5 100644 --- a/services/core.py +++ b/services/core.py @@ -93,8 +93,10 @@ class CacheStorage: if result: CacheStorage.authors = result for a in result: - self.authors_by_user[a.user] = a - self.authors_by_id[a.id] = a + user_id = a.get("user") + author_id = a.get("id") + self.authors_by_user[user_id] = a + self.authors_by_id[author_id] = a @staticmethod async def worker():