Merge branch 'develop' into refactor/deactivated_user_field
authorMark Felder <feld@feld.me>
Mon, 25 Jan 2021 15:45:06 +0000 (09:45 -0600)
committerMark Felder <feld@feld.me>
Mon, 25 Jan 2021 15:45:06 +0000 (09:45 -0600)
1  2 
CHANGELOG.md
lib/pleroma/user.ex
lib/pleroma/user/query.ex
test/pleroma/user_test.exs
test/pleroma/web/common_api_test.exs

diff --cc CHANGELOG.md
Simple merge
index b27923975161851f67adf7c768be9a427912bb6d,2aeacf8160ade0629dde2e3feb69de80b6a43361..e422b59f18c8d0d63148f0d4007b46d6c721d453
@@@ -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) ::
index e277f5fc2053204d184ef9d5f0faad84bd03d59c,4076925aaa1853a73ee5ce1680c1c1a8e3595786..fa46545dad167478f6705394e00145adeaf35fb8
@@@ -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
Simple merge
Simple merge