[#502] Fixed user_count in /api/v1/instance to include only active local users.

This commit is contained in:
Ivan Tashkinov 2019-01-17 19:16:02 +03:00
commit 954dc4a4ad
3 changed files with 15 additions and 5 deletions

View file

@ -796,7 +796,7 @@ defmodule Pleroma.User do
update_and_set_cache(cng)
end
def local_user_query() do
def local_user_query do
from(
u in User,
where: u.local == true,
@ -804,7 +804,14 @@ defmodule Pleroma.User do
)
end
def moderator_user_query() do
def active_local_user_query do
from(
u in local_user_query(),
where: fragment("?->'deactivated' @> 'false'", u.info)
)
end
def moderator_user_query do
from(
u in User,
where: u.local == true,