Add tests for counters being updated on follow

This commit is contained in:
rinpatch 2019-07-31 19:37:55 +03:00
commit 301ea0dc04
6 changed files with 93 additions and 21 deletions

View file

@ -741,7 +741,7 @@ defmodule Pleroma.User do
end
def update_follower_count(%User{} = user) do
unless !user.local and Pleroma.Config.get([:instance, :external_user_synchronization]) do
if user.local or !Pleroma.Config.get([:instance, :external_user_synchronization]) do
follower_count_query =
User.Query.build(%{followers: user, deactivated: false})
|> select([u], %{count: count(u.id)})