From: Mark Felder Date: Mon, 25 Jan 2021 15:45:06 +0000 (-0600) Subject: Merge branch 'develop' into refactor/deactivated_user_field X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=537ba1c5e07a33692ed63ca50b50e240efce6f88;p=akkoma Merge branch 'develop' into refactor/deactivated_user_field --- 537ba1c5e07a33692ed63ca50b50e240efce6f88 diff --cc lib/pleroma/user.ex index b27923975,2aeacf816..e422b59f1 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@@ -287,18 -286,10 +287,10 @@@ defmodule Pleroma.User d @doc "Returns status account" @spec account_status(User.t()) :: account_status() - def account_status(%User{deactivated: true}), do: :deactivated + def account_status(%User{is_active: false}), do: :deactivated def account_status(%User{password_reset_pending: true}), do: :password_reset_pending def account_status(%User{local: true, is_approved: false}), do: :approval_pending - - def account_status(%User{local: true, is_confirmed: false}) do - if Config.get([:instance, :account_activation_required]) do - :confirmation_pending - else - :active - end - end - + def account_status(%User{local: true, is_confirmed: false}), do: :confirmation_pending def account_status(%User{}), do: :active @spec visible_for(User.t(), User.t() | nil) :: diff --cc lib/pleroma/user/query.ex index e277f5fc2,4076925aa..fa46545da --- a/lib/pleroma/user/query.ex +++ b/lib/pleroma/user/query.ex @@@ -137,8 -137,9 +137,9 @@@ defmodule Pleroma.User.Query d defp compose_query({:external, _}, query), do: location_query(query, false) defp compose_query({:active, _}, query) do - User.restrict_deactivated(query) + where(query, [u], u.is_active == true) |> where([u], u.is_approved == true) + |> where([u], u.is_confirmed == true) end defp compose_query({:legacy_active, _}, query) do