This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user