From 634cec657c3fd3aa6ef2a6ba301a60214ed2ad07 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 16 Sep 2025 12:52:14 +0300 Subject: [PATCH] notifications-stats-todo --- rbac/api.py | 2 +- resolvers/follower.py | 2 +- resolvers/notifier.py | 3 ++- uv.lock | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/rbac/api.py b/rbac/api.py index b6d4492c..05b26720 100644 --- a/rbac/api.py +++ b/rbac/api.py @@ -385,7 +385,7 @@ def require_role(role: str) -> Callable: if not info or not hasattr(info, "context"): raise RBACError("GraphQL info context не найден") - user_roles, community_id = get_user_roles_from_context(info) + user_roles, _community_id = get_user_roles_from_context(info) if role not in user_roles: raise RBACError("Требуется роль в сообществе", role) diff --git a/resolvers/follower.py b/resolvers/follower.py index 6863af50..86df0c86 100644 --- a/resolvers/follower.py +++ b/resolvers/follower.py @@ -216,7 +216,7 @@ async def unfollow( logger.error(f"Неверный тип для отписки: {what}") return {"error": "invalid unfollow type"} - entity_class, follower_class, get_cached_follows_method, cache_method = entity_classes[what] + entity_class, follower_class, get_cached_follows_method, _cache_method = entity_classes[what] entity_type = what.lower() follows: list[dict[str, Any]] = [] diff --git a/resolvers/notifier.py b/resolvers/notifier.py index 368a9bb2..131454b2 100644 --- a/resolvers/notifier.py +++ b/resolvers/notifier.py @@ -105,7 +105,8 @@ def get_notifications_grouped(author_id: int, after: int = 0, limit: int = 10, o authors: List[NotificationAuthor], # List of authors involved in the thread. } """ - total, unread, notifications = query_notifications(author_id, after) + # TODO: use all stats + _total, _unread, notifications = query_notifications(author_id, after) groups_by_thread = {} groups_amount = 0 diff --git a/uv.lock b/uv.lock index 8072979d..63c16d2a 100644 --- a/uv.lock +++ b/uv.lock @@ -500,12 +500,12 @@ requires-dist = [ { name = "pyjwt", specifier = ">=2.10" }, { name = "redis", extras = ["hiredis"] }, { name = "scikit-learn", specifier = ">=1.7.0" }, - { name = "sentence-transformers", specifier = ">=2.2.0" }, + { name = "sentence-transformers" }, { name = "sentry-sdk", extras = ["starlette", "sqlalchemy"] }, { name = "sqlalchemy", specifier = ">=2.0.0" }, { name = "starlette" }, - { name = "torch", specifier = ">=2.1.0" }, - { name = "transformers", specifier = ">=4.56.0" }, + { name = "torch" }, + { name = "transformers" }, { name = "types-authlib" }, { name = "types-orjson" }, { name = "types-pyjwt" },