From dfeadf6a547504c1d49561ccc1830921bcfcd4a1 Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 30 Aug 2025 15:19:43 +0300 Subject: [PATCH] follow-resolver-fix --- resolvers/follower.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resolvers/follower.py b/resolvers/follower.py index 3f44c5c2..51bca292 100644 --- a/resolvers/follower.py +++ b/resolvers/follower.py @@ -92,6 +92,7 @@ async def follow( session.query(follower_class) .where( follower_class.follower == follower_id, # type: ignore[attr-defined] + follower_class.following == entity_id, # type: ignore[attr-defined] getattr(follower_class, entity_type) == entity_id, # type: ignore[attr-defined] ) .first() @@ -214,7 +215,9 @@ async def unfollow( .where( and_( follower_class.follower == follower_id, # type: ignore[attr-defined] - getattr(follower_class, entity_type) == entity_id, # type: ignore[attr-defined] + follower_class.following == entity_id + if entity_type == "AUTHOR" + else follower_class.topic == entity_id, # type: ignore[attr-defined] ) ) .first()