summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-01-20 20:07:30 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-01-20 20:07:30 +0000
commit91f74418b7758ffff9ef7356b1b2c2d7a9f884b7 (patch)
tree346c3d3f3e693ac48fef084c4c8f197442ca5399 /lib
parent3802718f80675ae4702b35bfc0da0454f7d4f48a (diff)
parentdfc4cb6ebd61754ee5865c33092c5e1b782c12cd (diff)
downloadpleroma-91f74418b7758ffff9ef7356b1b2c2d7a9f884b7.tar.gz
pleroma-91f74418b7758ffff9ef7356b1b2c2d7a9f884b7.zip
Merge branch 'fix/active-user-query' into 'develop'
Active users must be confirmed, and other related fixes See merge request pleroma/pleroma!3267
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/user.ex10
-rw-r--r--lib/pleroma/user/query.ex1
2 files changed, 2 insertions, 9 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index d81abbd2b..2aeacf816 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -289,15 +289,7 @@ defmodule Pleroma.User do
def account_status(%User{deactivated: true}), 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 --git a/lib/pleroma/user/query.ex b/lib/pleroma/user/query.ex
index 74ef1158a..4076925aa 100644
--- a/lib/pleroma/user/query.ex
+++ b/lib/pleroma/user/query.ex
@@ -139,6 +139,7 @@ defmodule Pleroma.User.Query do
defp compose_query({:active, _}, query) do
User.restrict_deactivated(query)
|> where([u], u.is_approved == true)
+ |> where([u], u.is_confirmed == true)
end
defp compose_query({:legacy_active, _}, query) do