This commit is contained in:
@@ -92,6 +92,7 @@ async def follow(
|
|||||||
session.query(follower_class)
|
session.query(follower_class)
|
||||||
.where(
|
.where(
|
||||||
follower_class.follower == follower_id, # type: ignore[attr-defined]
|
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]
|
getattr(follower_class, entity_type) == entity_id, # type: ignore[attr-defined]
|
||||||
)
|
)
|
||||||
.first()
|
.first()
|
||||||
@@ -214,7 +215,9 @@ async def unfollow(
|
|||||||
.where(
|
.where(
|
||||||
and_(
|
and_(
|
||||||
follower_class.follower == follower_id, # type: ignore[attr-defined]
|
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()
|
.first()
|
||||||
|
|||||||
Reference in New Issue
Block a user