mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-22 07:10:59 +00:00
Only do the followed query if needed
This commit is contained in:
parent
f16dcd04e4
commit
4bea1006b1
1 changed files with 5 additions and 5 deletions
|
@ -38,12 +38,12 @@ class FanOutStates(StateGraph):
|
|||
# or it's a reply to us or the author
|
||||
add = True
|
||||
mentioned = {identity.id for identity in post.mentions.all()}
|
||||
followed = await sync_to_async(set)(
|
||||
fan_out.identity.outbound_follows.filter(
|
||||
state__in=FollowStates.group_active()
|
||||
).values_list("target_id", flat=True)
|
||||
)
|
||||
if post.in_reply_to:
|
||||
followed = await sync_to_async(set)(
|
||||
fan_out.identity.outbound_follows.filter(
|
||||
state__in=FollowStates.group_active()
|
||||
).values_list("target_id", flat=True)
|
||||
)
|
||||
interested_in = followed.union(
|
||||
{post.author_id, fan_out.identity_id}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue