Don't count deactivated users in statistics

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-10-13 14:39:05 +02:00
parent c7ddbc1162
commit 01150af70e

View File

@ -280,7 +280,7 @@ defmodule Mobilizon.Users do
Counts users. Counts users.
""" """
@spec count_users :: integer @spec count_users :: integer
def count_users, do: Repo.one(from(u in User, select: count(u.id))) def count_users, do: Repo.one(from(u in User, select: count(u.id), where: u.disabled == false))
@doc """ @doc """
Gets a settings for an user. Gets a settings for an user.