make linter happy

This commit is contained in:
FloatingGhost 2021-12-06 11:50:51 +00:00
parent cd8bdbc761
commit db46913dcc
2 changed files with 3 additions and 5 deletions

View file

@ -362,8 +362,7 @@ def following_requests_for_actor(%User{ap_id: ap_id}) do
end end
def restrict_deactivated_users(query) do def restrict_deactivated_users(query) do
deactivated_users_query = deactivated_users_query = from(u in User.Query.build(%{deactivated: true}), select: u.ap_id)
from(u in User.Query.build(%{deactivated: true}), select: u.ap_id)
from(activity in query, where: activity.actor not in subquery(deactivated_users_query)) from(activity in query, where: activity.actor not in subquery(deactivated_users_query))
end end

View file

@ -783,14 +783,13 @@ test "doesn't return activities from deactivated users" do
{:ok, activity_one} = CommonAPI.post(deactivated, %{status: "hey!"}) {:ok, activity_one} = CommonAPI.post(deactivated, %{status: "hey!"})
{:ok, activity_two} = CommonAPI.post(active, %{status: "yay!"}) {:ok, activity_two} = CommonAPI.post(active, %{status: "yay!"})
{:ok, _updated_user} = User.set_activation(deactivated, false) {:ok, _updated_user} = User.set_activation(deactivated, false)
activities = ActivityPub.fetch_activities([], %{}) activities = ActivityPub.fetch_activities([], %{})
refute Enum.member?(activities, activity_one) refute Enum.member?(activities, activity_one)
assert Enum.member?(activities, activity_two) assert Enum.member?(activities, activity_two)
end end
test "always see your own posts even when they address people you block" do test "always see your own posts even when they address people you block" do
user = insert(:user) user = insert(:user)
blockee = insert(:user) blockee = insert(:user)