Fix note count update.

This commit is contained in:
lain 2018-11-18 18:52:21 +01:00
commit d5af41b577
3 changed files with 11 additions and 5 deletions

View file

@ -440,11 +440,13 @@ defmodule Pleroma.User do
note_count = Repo.one(note_count_query)
new_info = Map.put(user.info, "note_count", note_count)
info_cng = User.Info.set_note_count(user.info, note_count)
cs = info_changeset(user, %{info: new_info})
cng =
change(user)
|> put_embed(:info, info_cng)
update_and_set_cache(cs)
update_and_set_cache(cng)
end
def update_follower_count(%User{} = user) do