diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b8e8d2f4..ff37d3021 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed +- **Breaking:** Changed `mix pleroma.user toggle_confirmed` to `mix pleroma.user confirm` +- **Breaking**: AdminAPI changed User field `confirmation_pending` to `is_confirmed` - Polls now always return a `voters_count`, even if they are single-choice. - Admin Emails: The ap id is used as the user link in emails now. - Improved registration workflow for email confirmation and account approval modes. -- **Breaking:** Changed `mix pleroma.user toggle_confirmed` to `mix pleroma.user confirm` - Search: When using Postgres 11+, Pleroma will use the `websearch_to_tsvector` function to parse search queries. - Emoji: Support the full Unicode 13.1 set of Emoji for reactions, plus regional indicators. - Admin API: Reports now ordered by newest diff --git a/lib/mix/tasks/pleroma/email.ex b/lib/mix/tasks/pleroma/email.ex index 54f158f73..6b7555fb8 100644 --- a/lib/mix/tasks/pleroma/email.ex +++ b/lib/mix/tasks/pleroma/email.ex @@ -34,7 +34,7 @@ def run(["resend_confirmation_emails"]) do Pleroma.User.Query.build(%{ local: true, deactivated: false, - confirmation_pending: true, + is_confirmed: false, invisible: false }) |> Pleroma.Repo.chunk_stream(500) diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex index f90c045fe..e87f1c271 100644 --- a/lib/mix/tasks/pleroma/user.ex +++ b/lib/mix/tasks/pleroma/user.ex @@ -74,7 +74,7 @@ def run(["new", nickname, email | rest]) do bio: bio } - changeset = User.register_changeset(%User{}, params, need_confirmation: false) + changeset = User.register_changeset(%User{}, params, is_confirmed: true) {:ok, _user} = User.register(changeset) shell_info("User #{nickname} created") @@ -213,7 +213,7 @@ def run(["set", nickname | rest]) do user = case Keyword.get(options, :confirmed) do nil -> user - value -> set_confirmed(user, value) + value -> set_confirmation(user, value) end user = @@ -351,7 +351,7 @@ def run(["confirm", nickname]) do with %User{} = user <- User.get_cached_by_nickname(nickname) do {:ok, user} = User.confirm(user) - message = if user.confirmation_pending, do: "needs", else: "doesn't need" + message = if !user.is_confirmed, do: "needs", else: "doesn't need" shell_info("#{nickname} #{message} confirmation.") else @@ -373,7 +373,7 @@ def run(["confirm_all"]) do |> Pleroma.Repo.chunk_stream(500, :batches) |> Stream.each(fn users -> users - |> Enum.each(fn user -> User.need_confirmation(user, false) end) + |> Enum.each(fn user -> User.set_confirmation(user, true) end) end) |> Stream.run() end @@ -391,7 +391,7 @@ def run(["unconfirm_all"]) do |> Pleroma.Repo.chunk_stream(500, :batches) |> Stream.each(fn users -> users - |> Enum.each(fn user -> User.need_confirmation(user, true) end) + |> Enum.each(fn user -> User.set_confirmation(user, false) end) end) |> Stream.run() end @@ -454,10 +454,10 @@ defp set_locked(user, value) do user end - defp set_confirmed(user, value) do - {:ok, user} = User.need_confirmation(user, !value) + defp set_confirmation(user, value) do + {:ok, user} = User.set_confirmation(user, value) - shell_info("Confirmation pending status of #{user.nickname}: #{user.confirmation_pending}") + shell_info("Confirmation status of #{user.nickname}: #{user.is_confirmed}") user end end diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 6a81adfd6..9efc27887 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -110,7 +110,7 @@ defmodule Pleroma.User do field(:follower_count, :integer, default: 0) field(:following_count, :integer, default: 0) field(:is_locked, :boolean, default: false) - field(:confirmation_pending, :boolean, default: false) + field(:is_confirmed, :boolean, default: true) field(:password_reset_pending, :boolean, default: false) field(:approval_pending, :boolean, default: false) field(:registration_reason, :string, default: nil) @@ -290,7 +290,7 @@ 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, approval_pending: true}), do: :approval_pending - def account_status(%User{local: true, confirmation_pending: true}) do + def account_status(%User{local: true, is_confirmed: false}) do if Config.get([:instance, :account_activation_required]) do :confirmation_pending else @@ -704,11 +704,11 @@ def register_changeset(struct, params \\ %{}, opts \\ []) do reason_limit = Config.get([:instance, :registration_reason_length], 500) params = Map.put_new(params, :accepts_chat_messages, true) - need_confirmation? = - if is_nil(opts[:need_confirmation]) do - Config.get([:instance, :account_activation_required]) + confirmed? = + if is_nil(opts[:confirmed]) do + !Config.get([:instance, :account_activation_required]) else - opts[:need_confirmation] + opts[:confirmed] end need_approval? = @@ -719,7 +719,7 @@ def register_changeset(struct, params \\ %{}, opts \\ []) do end struct - |> confirmation_changeset(need_confirmation: need_confirmation?) + |> confirmation_changeset(set_confirmation: confirmed?) |> approval_changeset(need_approval: need_approval?) |> cast(params, [ :bio, @@ -808,7 +808,7 @@ def register(%Ecto.Changeset{} = changeset) do end end - def post_register_action(%User{confirmation_pending: true} = user) do + def post_register_action(%User{is_confirmed: false} = user) do with {:ok, _} <- try_send_confirmation_email(user) do {:ok, user} end @@ -821,7 +821,7 @@ def post_register_action(%User{approval_pending: true} = user) do end end - def post_register_action(%User{approval_pending: false, confirmation_pending: false} = user) do + def post_register_action(%User{approval_pending: false, is_confirmed: true} = user) do with {:ok, user} <- autofollow_users(user), {:ok, _} <- autofollowing_users(user), {:ok, user} <- set_cache(user), @@ -882,7 +882,7 @@ def send_welcome_email(%User{email: email} = user) when is_binary(email) do def send_welcome_email(_), do: {:ok, :noop} @spec try_send_confirmation_email(User.t()) :: {:ok, :enqueued | :noop} - def try_send_confirmation_email(%User{confirmation_pending: true, email: email} = user) + def try_send_confirmation_email(%User{is_confirmed: false, email: email} = user) when is_binary(email) do if Config.get([:instance, :account_activation_required]) do send_confirmation_email(user) @@ -1642,8 +1642,8 @@ def confirm(users) when is_list(users) do end) end - def confirm(%User{confirmation_pending: true} = user) do - with chg <- confirmation_changeset(user, need_confirmation: false), + def confirm(%User{is_confirmed: false} = user) do + with chg <- confirmation_changeset(user, set_confirmation: true), {:ok, user} <- update_and_set_cache(chg) do post_register_action(user) {:ok, user} @@ -1682,7 +1682,7 @@ def purge_user_changeset(user) do follower_count: 0, following_count: 0, is_locked: false, - confirmation_pending: false, + is_confirmed: true, password_reset_pending: false, approval_pending: false, registration_reason: nil, @@ -2138,10 +2138,10 @@ def touch_last_digest_emailed_at(user) do updated_user end - @spec need_confirmation(User.t(), boolean()) :: {:ok, User.t()} | {:error, Changeset.t()} - def need_confirmation(%User{} = user, bool) do + @spec set_confirmation(User.t(), boolean()) :: {:ok, User.t()} | {:error, Changeset.t()} + def set_confirmation(%User{} = user, bool) do user - |> confirmation_changeset(need_confirmation: bool) + |> confirmation_changeset(set_confirmation: bool) |> update_and_set_cache() end @@ -2309,21 +2309,21 @@ def mastodon_settings_update(user, settings) do end @spec confirmation_changeset(User.t(), keyword()) :: Changeset.t() - def confirmation_changeset(user, need_confirmation: need_confirmation?) do + def confirmation_changeset(user, set_confirmation: confirmed?) do params = - if need_confirmation? do + if confirmed? do %{ - confirmation_pending: true, - confirmation_token: :crypto.strong_rand_bytes(32) |> Base.url_encode64() + is_confirmed: true, + confirmation_token: nil } else %{ - confirmation_pending: false, - confirmation_token: nil + is_confirmed: false, + confirmation_token: :crypto.strong_rand_bytes(32) |> Base.url_encode64() } end - cast(user, params, [:confirmation_pending, :confirmation_token]) + cast(user, params, [:is_confirmed, :confirmation_token]) end @spec approval_changeset(User.t(), keyword()) :: Changeset.t() diff --git a/lib/pleroma/user/query.ex b/lib/pleroma/user/query.ex index ab9554bd2..481c41d8c 100644 --- a/lib/pleroma/user/query.ex +++ b/lib/pleroma/user/query.ex @@ -155,7 +155,7 @@ defp compose_query({:deactivated, true}, query) do end defp compose_query({:confirmation_pending, bool}, query) do - where(query, [u], u.confirmation_pending == ^bool) + where(query, [u], u.is_confirmed != ^bool) end defp compose_query({:need_approval, _}, query) do @@ -163,7 +163,7 @@ defp compose_query({:need_approval, _}, query) do end defp compose_query({:unconfirmed, _}, query) do - where(query, [u], u.confirmation_pending) + where(query, [u], u.is_confirmed == false) end defp compose_query({:followers, %User{id: id}}, query) do diff --git a/lib/pleroma/web/admin_api/views/account_view.ex b/lib/pleroma/web/admin_api/views/account_view.ex index 37188bfeb..10d2e698b 100644 --- a/lib/pleroma/web/admin_api/views/account_view.ex +++ b/lib/pleroma/web/admin_api/views/account_view.ex @@ -77,7 +77,7 @@ def render("show.json", %{user: user}) do "local" => user.local, "roles" => User.roles(user), "tags" => user.tags || [], - "confirmation_pending" => user.confirmation_pending, + "is_confirmed" => user.is_confirmed, "approval_pending" => user.approval_pending, "url" => user.uri || user.ap_id, "registration_reason" => user.registration_reason, diff --git a/lib/pleroma/web/api_spec/operations/admin/report_operation.ex b/lib/pleroma/web/api_spec/operations/admin/report_operation.ex index 526698fc1..d60e84a66 100644 --- a/lib/pleroma/web/api_spec/operations/admin/report_operation.ex +++ b/lib/pleroma/web/api_spec/operations/admin/report_operation.ex @@ -191,7 +191,7 @@ defp account_admin do moderator: %Schema{type: :boolean} } }, - confirmation_pending: %Schema{type: :boolean} + is_confirmed: %Schema{type: :boolean} }) } end diff --git a/lib/pleroma/web/api_spec/operations/admin/status_operation.ex b/lib/pleroma/web/api_spec/operations/admin/status_operation.ex index a2319bacc..fed3da27a 100644 --- a/lib/pleroma/web/api_spec/operations/admin/status_operation.ex +++ b/lib/pleroma/web/api_spec/operations/admin/status_operation.ex @@ -142,7 +142,7 @@ def admin_account do } }, tags: %Schema{type: :string}, - confirmation_pending: %Schema{type: :string} + is_confirmed: %Schema{type: :string} } } end diff --git a/lib/pleroma/web/api_spec/operations/chat_operation.ex b/lib/pleroma/web/api_spec/operations/chat_operation.ex index a90bc4cc9..e5ee6e695 100644 --- a/lib/pleroma/web/api_spec/operations/chat_operation.ex +++ b/lib/pleroma/web/api_spec/operations/chat_operation.ex @@ -236,7 +236,7 @@ def chats_response do "account" => %{ "pleroma" => %{ "is_admin" => false, - "confirmation_pending" => false, + "is_confirmed" => true, "hide_followers_count" => false, "is_moderator" => false, "hide_favorites" => true, diff --git a/lib/pleroma/web/api_spec/schemas/account.ex b/lib/pleroma/web/api_spec/schemas/account.ex index 35158c140..4f9b564d1 100644 --- a/lib/pleroma/web/api_spec/schemas/account.ex +++ b/lib/pleroma/web/api_spec/schemas/account.ex @@ -48,7 +48,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do }, background_image: %Schema{type: :string, nullable: true, format: :uri}, chat_token: %Schema{type: :string}, - confirmation_pending: %Schema{ + is_confirmed: %Schema{ type: :boolean, description: "whether the user account is waiting on email confirmation to be activated" @@ -166,7 +166,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do "pleroma" => %{ "allow_following_move" => true, "background_image" => nil, - "confirmation_pending" => true, + "is_confirmed" => false, "hide_favorites" => true, "hide_followers" => false, "hide_followers_count" => false, diff --git a/lib/pleroma/web/api_spec/schemas/chat.ex b/lib/pleroma/web/api_spec/schemas/chat.ex index b3912c173..4afed910d 100644 --- a/lib/pleroma/web/api_spec/schemas/chat.ex +++ b/lib/pleroma/web/api_spec/schemas/chat.ex @@ -23,7 +23,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Chat do "account" => %{ "pleroma" => %{ "is_admin" => false, - "confirmation_pending" => false, + "is_confirmed" => true, "hide_followers_count" => false, "is_moderator" => false, "hide_favorites" => true, diff --git a/lib/pleroma/web/api_spec/schemas/status.ex b/lib/pleroma/web/api_spec/schemas/status.ex index 3f5870907..61ebd8089 100644 --- a/lib/pleroma/web/api_spec/schemas/status.ex +++ b/lib/pleroma/web/api_spec/schemas/status.ex @@ -256,7 +256,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do "note" => "Tester Number 6", "pleroma" => %{ "background_image" => nil, - "confirmation_pending" => false, + "is_confirmed" => true, "hide_favorites" => true, "hide_followers" => false, "hide_followers_count" => false, diff --git a/lib/pleroma/web/auth/pleroma_authenticator.ex b/lib/pleroma/web/auth/pleroma_authenticator.ex index a2121e6a7..401f23c9f 100644 --- a/lib/pleroma/web/auth/pleroma_authenticator.ex +++ b/lib/pleroma/web/auth/pleroma_authenticator.ex @@ -84,7 +84,7 @@ def create_from_registration( password_confirmation: random_password }, external: true, - need_confirmation: false + confirmed: true ) |> Repo.insert(), {:ok, _} <- diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex index 2768f0291..da1221d47 100644 --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -266,7 +266,7 @@ defp do_render("show.json", %{user: user} = opts) do pleroma: %{ ap_id: user.ap_id, also_known_as: user.also_known_as, - confirmation_pending: user.confirmation_pending, + is_confirmed: user.is_confirmed, tags: user.tags, hide_followers_count: user.hide_followers_count, hide_follows_count: user.hide_follows_count, diff --git a/lib/pleroma/web/twitter_api/controller.ex b/lib/pleroma/web/twitter_api/controller.ex index 467c19e5e..077bfa70d 100644 --- a/lib/pleroma/web/twitter_api/controller.ex +++ b/lib/pleroma/web/twitter_api/controller.ex @@ -30,7 +30,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do def confirm_email(conn, %{"user_id" => uid, "token" => token}) do with %User{} = user <- User.get_cached_by_id(uid), - true <- user.local and user.confirmation_pending and user.confirmation_token == token, + true <- user.local and !user.is_confirmed and user.confirmation_token == token, {:ok, _} <- User.confirm(user) do redirect(conn, to: "/") end diff --git a/priv/repo/migrations/20201013184200_refactor_confirmation_pending_user_field.exs b/priv/repo/migrations/20201013184200_refactor_confirmation_pending_user_field.exs new file mode 100644 index 000000000..d0dc42827 --- /dev/null +++ b/priv/repo/migrations/20201013184200_refactor_confirmation_pending_user_field.exs @@ -0,0 +1,20 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2020 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Repo.Migrations.RefactorConfirmationPendingUserField do + use Ecto.Migration + + def up do + # Flip the values before we change the meaning of the column + execute("UPDATE users SET confirmation_pending = NOT confirmation_pending;") + execute("ALTER TABLE users RENAME COLUMN confirmation_pending TO is_confirmed;") + execute("ALTER TABLE users ALTER COLUMN is_confirmed SET DEFAULT true;") + end + + def down do + execute("UPDATE users SET is_confirmed = NOT is_confirmed;") + execute("ALTER TABLE users RENAME COLUMN is_confirmed TO confirmation_pending;") + execute("ALTER TABLE users ALTER COLUMN confirmation_pending SET DEFAULT false;") + end +end diff --git a/priv/repo/migrations/20201231185546_confirm_logged_in_users.exs b/priv/repo/migrations/20201231185546_confirm_logged_in_users.exs index 4372d093f..b9656c17b 100644 --- a/priv/repo/migrations/20201231185546_confirm_logged_in_users.exs +++ b/priv/repo/migrations/20201231185546_confirm_logged_in_users.exs @@ -11,9 +11,9 @@ defmodule Pleroma.Repo.Migrations.ConfirmLoggedInUsers do def up do User - |> where([u], u.confirmation_pending == true) + |> where([u], u.is_confirmed == false) |> join(:inner, [u], t in Token, on: t.user_id == u.id) - |> Repo.update_all(set: [confirmation_pending: false]) + |> Repo.update_all(set: [is_confirmed: true]) end def down do diff --git a/priv/static/adminfe/chunk-03c5.e6a0e2d0.css b/priv/static/adminfe/chunk-03c5.3368e00c.css similarity index 100% rename from priv/static/adminfe/chunk-03c5.e6a0e2d0.css rename to priv/static/adminfe/chunk-03c5.3368e00c.css diff --git a/priv/static/adminfe/chunk-0492.15b0611f.css b/priv/static/adminfe/chunk-0492.15b0611f.css deleted file mode 100644 index 13537842a..000000000 Binary files a/priv/static/adminfe/chunk-0492.15b0611f.css and /dev/null differ diff --git a/priv/static/adminfe/chunk-0537.cd83e5d6.css b/priv/static/adminfe/chunk-0537.76929cff.css similarity index 100% rename from priv/static/adminfe/chunk-0537.cd83e5d6.css rename to priv/static/adminfe/chunk-0537.76929cff.css diff --git a/priv/static/adminfe/chunk-1e1e.5980e665.css b/priv/static/adminfe/chunk-1e1e.5980e665.css new file mode 100644 index 000000000..1b3a9fcab Binary files /dev/null and b/priv/static/adminfe/chunk-1e1e.5980e665.css differ diff --git a/priv/static/adminfe/chunk-1944.731ba892.css b/priv/static/adminfe/chunk-35b1.949db050.css similarity index 100% rename from priv/static/adminfe/chunk-1944.731ba892.css rename to priv/static/adminfe/chunk-35b1.949db050.css diff --git a/priv/static/adminfe/chunk-4770.20caaae1.css b/priv/static/adminfe/chunk-4770.20caaae1.css new file mode 100644 index 000000000..6f2331666 Binary files /dev/null and b/priv/static/adminfe/chunk-4770.20caaae1.css differ diff --git a/priv/static/adminfe/chunk-50ba.6e4bf9f4.css b/priv/static/adminfe/chunk-50ba.6e4bf9f4.css new file mode 100644 index 000000000..db662fad6 Binary files /dev/null and b/priv/static/adminfe/chunk-50ba.6e4bf9f4.css differ diff --git a/priv/static/adminfe/chunk-04b0.7e25cd78.css b/priv/static/adminfe/chunk-606c.7c5b0a08.css similarity index 100% rename from priv/static/adminfe/chunk-04b0.7e25cd78.css rename to priv/static/adminfe/chunk-606c.7c5b0a08.css diff --git a/priv/static/adminfe/chunk-68ea9.8331e95e.css b/priv/static/adminfe/chunk-68ea9.892994aa.css similarity index 100% rename from priv/static/adminfe/chunk-68ea9.8331e95e.css rename to priv/static/adminfe/chunk-68ea9.892994aa.css diff --git a/priv/static/adminfe/chunk-6e81.559b76f9.css b/priv/static/adminfe/chunk-6e81.687d5046.css similarity index 100% rename from priv/static/adminfe/chunk-6e81.559b76f9.css rename to priv/static/adminfe/chunk-6e81.687d5046.css diff --git a/priv/static/adminfe/chunk-ad1e.1a3c5339.css b/priv/static/adminfe/chunk-7041.c5f6eab7.css similarity index 100% rename from priv/static/adminfe/chunk-ad1e.1a3c5339.css rename to priv/static/adminfe/chunk-7041.c5f6eab7.css diff --git a/priv/static/adminfe/chunk-7968.283bc086.css b/priv/static/adminfe/chunk-7968.283bc086.css deleted file mode 100644 index 5d9863d3a..000000000 Binary files a/priv/static/adminfe/chunk-7968.283bc086.css and /dev/null differ diff --git a/priv/static/adminfe/chunk-7968.613084d0.css b/priv/static/adminfe/chunk-7968.613084d0.css new file mode 100644 index 000000000..5794e0a91 Binary files /dev/null and b/priv/static/adminfe/chunk-7968.613084d0.css differ diff --git a/priv/static/adminfe/chunk-8fbb.dd321643.css b/priv/static/adminfe/chunk-8fbb.dd321643.css deleted file mode 100644 index f50d974bd..000000000 Binary files a/priv/static/adminfe/chunk-8fbb.dd321643.css and /dev/null differ diff --git a/priv/static/adminfe/chunk-e660.9e75af5b.css b/priv/static/adminfe/chunk-e660.62c077ac.css similarity index 100% rename from priv/static/adminfe/chunk-e660.9e75af5b.css rename to priv/static/adminfe/chunk-e660.62c077ac.css diff --git a/priv/static/adminfe/chunk-f364.4fd16c53.css b/priv/static/adminfe/chunk-f364.4fd16c53.css new file mode 100644 index 000000000..abea7d536 Binary files /dev/null and b/priv/static/adminfe/chunk-f364.4fd16c53.css differ diff --git a/priv/static/adminfe/chunk-f364.6b5f3f0d.css b/priv/static/adminfe/chunk-f364.6b5f3f0d.css deleted file mode 100644 index ec665da84..000000000 Binary files a/priv/static/adminfe/chunk-f364.6b5f3f0d.css and /dev/null differ diff --git a/priv/static/adminfe/chunk-f625.bcd0ea3b.css b/priv/static/adminfe/chunk-f625.bcd0ea3b.css deleted file mode 100644 index ac26ef0f5..000000000 Binary files a/priv/static/adminfe/chunk-f625.bcd0ea3b.css and /dev/null differ diff --git a/priv/static/adminfe/index.html b/priv/static/adminfe/index.html index e6af40e97..693b13e41 100644 --- a/priv/static/adminfe/index.html +++ b/priv/static/adminfe/index.html @@ -1 +1 @@ -Admin FE
\ No newline at end of file +Admin FE
\ No newline at end of file diff --git a/priv/static/adminfe/static/js/app.3e54b198.js b/priv/static/adminfe/static/js/app.3e54b198.js new file mode 100644 index 000000000..1bd1760ec Binary files /dev/null and b/priv/static/adminfe/static/js/app.3e54b198.js differ diff --git a/priv/static/adminfe/static/js/app.3e54b198.js.map b/priv/static/adminfe/static/js/app.3e54b198.js.map new file mode 100644 index 000000000..4c682a65c Binary files /dev/null and b/priv/static/adminfe/static/js/app.3e54b198.js.map differ diff --git a/priv/static/adminfe/static/js/app.c67f9a2f.js b/priv/static/adminfe/static/js/app.c67f9a2f.js deleted file mode 100644 index 65f9d4a29..000000000 Binary files a/priv/static/adminfe/static/js/app.c67f9a2f.js and /dev/null differ diff --git a/priv/static/adminfe/static/js/app.c67f9a2f.js.map b/priv/static/adminfe/static/js/app.c67f9a2f.js.map deleted file mode 100644 index 41b4375aa..000000000 Binary files a/priv/static/adminfe/static/js/app.c67f9a2f.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-03c5.6de0c4c7.js b/priv/static/adminfe/static/js/chunk-03c5.1b0ab243.js similarity index 99% rename from priv/static/adminfe/static/js/chunk-03c5.6de0c4c7.js rename to priv/static/adminfe/static/js/chunk-03c5.1b0ab243.js index a89c65572..94dfce1a8 100644 Binary files a/priv/static/adminfe/static/js/chunk-03c5.6de0c4c7.js and b/priv/static/adminfe/static/js/chunk-03c5.1b0ab243.js differ diff --git a/priv/static/adminfe/static/js/chunk-03c5.6de0c4c7.js.map b/priv/static/adminfe/static/js/chunk-03c5.1b0ab243.js.map similarity index 99% rename from priv/static/adminfe/static/js/chunk-03c5.6de0c4c7.js.map rename to priv/static/adminfe/static/js/chunk-03c5.1b0ab243.js.map index 963ff6dee..acf1ba219 100644 Binary files a/priv/static/adminfe/static/js/chunk-03c5.6de0c4c7.js.map and b/priv/static/adminfe/static/js/chunk-03c5.1b0ab243.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-0492.47abe1dc.js b/priv/static/adminfe/static/js/chunk-0492.47abe1dc.js deleted file mode 100644 index 243ecde70..000000000 Binary files a/priv/static/adminfe/static/js/chunk-0492.47abe1dc.js and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-0492.47abe1dc.js.map b/priv/static/adminfe/static/js/chunk-0492.47abe1dc.js.map deleted file mode 100644 index f5e0d9ebc..000000000 Binary files a/priv/static/adminfe/static/js/chunk-0492.47abe1dc.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-04b0.90c6d24c.js b/priv/static/adminfe/static/js/chunk-04b0.90c6d24c.js deleted file mode 100644 index 9d0352814..000000000 Binary files a/priv/static/adminfe/static/js/chunk-04b0.90c6d24c.js and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-04b0.90c6d24c.js.map b/priv/static/adminfe/static/js/chunk-04b0.90c6d24c.js.map deleted file mode 100644 index a9bee3721..000000000 Binary files a/priv/static/adminfe/static/js/chunk-04b0.90c6d24c.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-0537.74db16b0.js b/priv/static/adminfe/static/js/chunk-0537.74db16b0.js deleted file mode 100644 index 35231e562..000000000 Binary files a/priv/static/adminfe/static/js/chunk-0537.74db16b0.js and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-0537.74db16b0.js.map b/priv/static/adminfe/static/js/chunk-0537.74db16b0.js.map deleted file mode 100644 index fa87bd76d..000000000 Binary files a/priv/static/adminfe/static/js/chunk-0537.74db16b0.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-0537.d0eef370.js b/priv/static/adminfe/static/js/chunk-0537.d0eef370.js new file mode 100644 index 000000000..f1b73a18a Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-0537.d0eef370.js differ diff --git a/priv/static/adminfe/static/js/chunk-0537.d0eef370.js.map b/priv/static/adminfe/static/js/chunk-0537.d0eef370.js.map new file mode 100644 index 000000000..e0a2f4d21 Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-0537.d0eef370.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-1944.7bed0c4b.js.map b/priv/static/adminfe/static/js/chunk-1944.7bed0c4b.js.map deleted file mode 100644 index 23229293e..000000000 Binary files a/priv/static/adminfe/static/js/chunk-1944.7bed0c4b.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js b/priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js new file mode 100644 index 000000000..65d0aa926 Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js differ diff --git a/priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js.map b/priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js.map new file mode 100644 index 000000000..a0b5ca3be Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-1944.7bed0c4b.js b/priv/static/adminfe/static/js/chunk-35b1.51b3140e.js similarity index 87% rename from priv/static/adminfe/static/js/chunk-1944.7bed0c4b.js rename to priv/static/adminfe/static/js/chunk-35b1.51b3140e.js index 87590c6ce..525814336 100644 Binary files a/priv/static/adminfe/static/js/chunk-1944.7bed0c4b.js and b/priv/static/adminfe/static/js/chunk-35b1.51b3140e.js differ diff --git a/priv/static/adminfe/static/js/chunk-35b1.51b3140e.js.map b/priv/static/adminfe/static/js/chunk-35b1.51b3140e.js.map new file mode 100644 index 000000000..92b6cece6 Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-35b1.51b3140e.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-4770.1c1fff97.js b/priv/static/adminfe/static/js/chunk-4770.1c1fff97.js new file mode 100644 index 000000000..706ede69e Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-4770.1c1fff97.js differ diff --git a/priv/static/adminfe/static/js/chunk-4770.1c1fff97.js.map b/priv/static/adminfe/static/js/chunk-4770.1c1fff97.js.map new file mode 100644 index 000000000..f1303900d Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-4770.1c1fff97.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-50ba.afb924bf.js b/priv/static/adminfe/static/js/chunk-50ba.afb924bf.js new file mode 100644 index 000000000..34fa95e8b Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-50ba.afb924bf.js differ diff --git a/priv/static/adminfe/static/js/chunk-50ba.afb924bf.js.map b/priv/static/adminfe/static/js/chunk-50ba.afb924bf.js.map new file mode 100644 index 000000000..909103765 Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-50ba.afb924bf.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-606c.f5585a4f.js b/priv/static/adminfe/static/js/chunk-606c.f5585a4f.js new file mode 100644 index 000000000..3bd1f7001 Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-606c.f5585a4f.js differ diff --git a/priv/static/adminfe/static/js/chunk-606c.f5585a4f.js.map b/priv/static/adminfe/static/js/chunk-606c.f5585a4f.js.map new file mode 100644 index 000000000..48434d04e Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-606c.f5585a4f.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-68ea9.2b2877d5.js b/priv/static/adminfe/static/js/chunk-68ea9.5a11341a.js similarity index 99% rename from priv/static/adminfe/static/js/chunk-68ea9.2b2877d5.js rename to priv/static/adminfe/static/js/chunk-68ea9.5a11341a.js index 60056454d..b11c19485 100644 Binary files a/priv/static/adminfe/static/js/chunk-68ea9.2b2877d5.js and b/priv/static/adminfe/static/js/chunk-68ea9.5a11341a.js differ diff --git a/priv/static/adminfe/static/js/chunk-68ea9.2b2877d5.js.map b/priv/static/adminfe/static/js/chunk-68ea9.5a11341a.js.map similarity index 99% rename from priv/static/adminfe/static/js/chunk-68ea9.2b2877d5.js.map rename to priv/static/adminfe/static/js/chunk-68ea9.5a11341a.js.map index 9e26519c3..8779a5e95 100644 Binary files a/priv/static/adminfe/static/js/chunk-68ea9.2b2877d5.js.map and b/priv/static/adminfe/static/js/chunk-68ea9.5a11341a.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-6e81.afade883.js b/priv/static/adminfe/static/js/chunk-6e81.6c4f2ce1.js similarity index 97% rename from priv/static/adminfe/static/js/chunk-6e81.afade883.js rename to priv/static/adminfe/static/js/chunk-6e81.6c4f2ce1.js index 3b5dd6c5c..6fd67c44f 100644 Binary files a/priv/static/adminfe/static/js/chunk-6e81.afade883.js and b/priv/static/adminfe/static/js/chunk-6e81.6c4f2ce1.js differ diff --git a/priv/static/adminfe/static/js/chunk-6e81.afade883.js.map b/priv/static/adminfe/static/js/chunk-6e81.6c4f2ce1.js.map similarity index 98% rename from priv/static/adminfe/static/js/chunk-6e81.afade883.js.map rename to priv/static/adminfe/static/js/chunk-6e81.6c4f2ce1.js.map index a0f7fca19..931f7521e 100644 Binary files a/priv/static/adminfe/static/js/chunk-6e81.afade883.js.map and b/priv/static/adminfe/static/js/chunk-6e81.6c4f2ce1.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-ad1e.eba9db26.js b/priv/static/adminfe/static/js/chunk-7041.9658c334.js similarity index 81% rename from priv/static/adminfe/static/js/chunk-ad1e.eba9db26.js rename to priv/static/adminfe/static/js/chunk-7041.9658c334.js index 82ddd4df2..837b3a897 100644 Binary files a/priv/static/adminfe/static/js/chunk-ad1e.eba9db26.js and b/priv/static/adminfe/static/js/chunk-7041.9658c334.js differ diff --git a/priv/static/adminfe/static/js/chunk-7041.9658c334.js.map b/priv/static/adminfe/static/js/chunk-7041.9658c334.js.map new file mode 100644 index 000000000..c02d84217 Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-7041.9658c334.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-7968.d6317b83.js b/priv/static/adminfe/static/js/chunk-7968.d6317b83.js new file mode 100644 index 000000000..cb6371cfe Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-7968.d6317b83.js differ diff --git a/priv/static/adminfe/static/js/chunk-7968.d6317b83.js.map b/priv/static/adminfe/static/js/chunk-7968.d6317b83.js.map new file mode 100644 index 000000000..455fe8cb4 Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-7968.d6317b83.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-7968.f51e3292.js b/priv/static/adminfe/static/js/chunk-7968.f51e3292.js deleted file mode 100644 index dc981706f..000000000 Binary files a/priv/static/adminfe/static/js/chunk-7968.f51e3292.js and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-7968.f51e3292.js.map b/priv/static/adminfe/static/js/chunk-7968.f51e3292.js.map deleted file mode 100644 index c2f0726b7..000000000 Binary files a/priv/static/adminfe/static/js/chunk-7968.f51e3292.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-8fbb.c847ce9d.js b/priv/static/adminfe/static/js/chunk-8fbb.c847ce9d.js deleted file mode 100644 index 74ffe9194..000000000 Binary files a/priv/static/adminfe/static/js/chunk-8fbb.c847ce9d.js and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-8fbb.c847ce9d.js.map b/priv/static/adminfe/static/js/chunk-8fbb.c847ce9d.js.map deleted file mode 100644 index b3c3b5fe8..000000000 Binary files a/priv/static/adminfe/static/js/chunk-8fbb.c847ce9d.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-ad1e.eba9db26.js.map b/priv/static/adminfe/static/js/chunk-ad1e.eba9db26.js.map deleted file mode 100644 index d74c2498f..000000000 Binary files a/priv/static/adminfe/static/js/chunk-ad1e.eba9db26.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-e660.feca27c4.js b/priv/static/adminfe/static/js/chunk-e660.2101cafc.js similarity index 99% rename from priv/static/adminfe/static/js/chunk-e660.feca27c4.js rename to priv/static/adminfe/static/js/chunk-e660.2101cafc.js index 5659d263e..20ecbb5a4 100644 Binary files a/priv/static/adminfe/static/js/chunk-e660.feca27c4.js and b/priv/static/adminfe/static/js/chunk-e660.2101cafc.js differ diff --git a/priv/static/adminfe/static/js/chunk-e660.feca27c4.js.map b/priv/static/adminfe/static/js/chunk-e660.2101cafc.js.map similarity index 99% rename from priv/static/adminfe/static/js/chunk-e660.feca27c4.js.map rename to priv/static/adminfe/static/js/chunk-e660.2101cafc.js.map index cfc2e08af..2ff5149ad 100644 Binary files a/priv/static/adminfe/static/js/chunk-e660.feca27c4.js.map and b/priv/static/adminfe/static/js/chunk-e660.2101cafc.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-f364.1122502b.js b/priv/static/adminfe/static/js/chunk-f364.1122502b.js deleted file mode 100644 index facad2ed5..000000000 Binary files a/priv/static/adminfe/static/js/chunk-f364.1122502b.js and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-f364.1122502b.js.map b/priv/static/adminfe/static/js/chunk-f364.1122502b.js.map deleted file mode 100644 index f89dabe30..000000000 Binary files a/priv/static/adminfe/static/js/chunk-f364.1122502b.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-f364.f22b0eee.js b/priv/static/adminfe/static/js/chunk-f364.f22b0eee.js new file mode 100644 index 000000000..fb1546f1f Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-f364.f22b0eee.js differ diff --git a/priv/static/adminfe/static/js/chunk-f364.f22b0eee.js.map b/priv/static/adminfe/static/js/chunk-f364.f22b0eee.js.map new file mode 100644 index 000000000..79292c5d5 Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-f364.f22b0eee.js.map differ diff --git a/priv/static/adminfe/static/js/chunk-f625.904137fd.js b/priv/static/adminfe/static/js/chunk-f625.904137fd.js deleted file mode 100644 index 053590b28..000000000 Binary files a/priv/static/adminfe/static/js/chunk-f625.904137fd.js and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-f625.904137fd.js.map b/priv/static/adminfe/static/js/chunk-f625.904137fd.js.map deleted file mode 100644 index 59c1c274e..000000000 Binary files a/priv/static/adminfe/static/js/chunk-f625.904137fd.js.map and /dev/null differ diff --git a/priv/static/adminfe/static/js/chunk-libs.32ea9181.js b/priv/static/adminfe/static/js/chunk-libs.5ca2c8e8.js similarity index 99% rename from priv/static/adminfe/static/js/chunk-libs.32ea9181.js rename to priv/static/adminfe/static/js/chunk-libs.5ca2c8e8.js index 29cfb2b1d..a496b679c 100644 Binary files a/priv/static/adminfe/static/js/chunk-libs.32ea9181.js and b/priv/static/adminfe/static/js/chunk-libs.5ca2c8e8.js differ diff --git a/priv/static/adminfe/static/js/chunk-libs.32ea9181.js.map b/priv/static/adminfe/static/js/chunk-libs.5ca2c8e8.js.map similarity index 99% rename from priv/static/adminfe/static/js/chunk-libs.32ea9181.js.map rename to priv/static/adminfe/static/js/chunk-libs.5ca2c8e8.js.map index c80cf9acc..3b2db293f 100644 Binary files a/priv/static/adminfe/static/js/chunk-libs.32ea9181.js.map and b/priv/static/adminfe/static/js/chunk-libs.5ca2c8e8.js.map differ diff --git a/priv/static/adminfe/static/js/runtime.52fd11cf.js b/priv/static/adminfe/static/js/runtime.52fd11cf.js new file mode 100644 index 000000000..6be53974a Binary files /dev/null and b/priv/static/adminfe/static/js/runtime.52fd11cf.js differ diff --git a/priv/static/adminfe/static/js/runtime.52fd11cf.js.map b/priv/static/adminfe/static/js/runtime.52fd11cf.js.map new file mode 100644 index 000000000..56adfca2a Binary files /dev/null and b/priv/static/adminfe/static/js/runtime.52fd11cf.js.map differ diff --git a/priv/static/adminfe/static/js/runtime.ba96836e.js b/priv/static/adminfe/static/js/runtime.ba96836e.js deleted file mode 100644 index 245c7fe20..000000000 Binary files a/priv/static/adminfe/static/js/runtime.ba96836e.js and /dev/null differ diff --git a/priv/static/adminfe/static/js/runtime.ba96836e.js.map b/priv/static/adminfe/static/js/runtime.ba96836e.js.map deleted file mode 100644 index f3c5a82af..000000000 Binary files a/priv/static/adminfe/static/js/runtime.ba96836e.js.map and /dev/null differ diff --git a/test/mix/tasks/pleroma/email_test.exs b/test/mix/tasks/pleroma/email_test.exs index 78cdf178b..ef26142c4 100644 --- a/test/mix/tasks/pleroma/email_test.exs +++ b/test/mix/tasks/pleroma/email_test.exs @@ -61,7 +61,7 @@ test "Sends test email with given address" do test "Sends confirmation emails" do local_user1 = insert(:user, %{ - confirmation_pending: true, + is_confirmed: false, confirmation_token: "mytoken", deactivated: false, email: "local1@pleroma.com", @@ -70,7 +70,7 @@ test "Sends confirmation emails" do local_user2 = insert(:user, %{ - confirmation_pending: true, + is_confirmed: false, confirmation_token: "mytoken", deactivated: false, email: "local2@pleroma.com", @@ -88,7 +88,7 @@ test "Sends confirmation emails" do test "Does not send confirmation email to inappropriate users" do # confirmed user insert(:user, %{ - confirmation_pending: false, + is_confirmed: true, confirmation_token: "mytoken", deactivated: false, email: "confirmed@pleroma.com", diff --git a/test/mix/tasks/pleroma/user_test.exs b/test/mix/tasks/pleroma/user_test.exs index 7c68b8a37..2b5232283 100644 --- a/test/mix/tasks/pleroma/user_test.exs +++ b/test/mix/tasks/pleroma/user_test.exs @@ -238,7 +238,7 @@ test "All statuses set" do assert message =~ ~r/Admin status .* true/ assert_received {:mix_shell, :info, [message]} - assert message =~ ~r/Confirmation pending .* false/ + assert message =~ ~r/Confirmation status.* true/ assert_received {:mix_shell, :info, [message]} assert message =~ ~r/Locked status .* true/ @@ -250,7 +250,7 @@ test "All statuses set" do assert user.is_moderator assert user.is_locked assert user.is_admin - refute user.confirmation_pending + assert user.is_confirmed end test "All statuses unset" do @@ -259,7 +259,7 @@ test "All statuses unset" do is_locked: true, is_moderator: true, is_admin: true, - confirmation_pending: true + is_confirmed: false ) Mix.Tasks.Pleroma.User.run([ @@ -275,7 +275,7 @@ test "All statuses unset" do assert message =~ ~r/Admin status .* false/ assert_received {:mix_shell, :info, [message]} - assert message =~ ~r/Confirmation pending .* true/ + assert message =~ ~r/Confirmation status.* false/ assert_received {:mix_shell, :info, [message]} assert message =~ ~r/Locked status .* false/ @@ -287,7 +287,7 @@ test "All statuses unset" do refute user.is_moderator refute user.is_locked refute user.is_admin - assert user.confirmation_pending + refute user.is_confirmed end test "no user to set status" do @@ -436,13 +436,6 @@ test "invite is revoked" do assert_received {:mix_shell, :info, [message]} assert message =~ "Invite for token #{invite.token} was revoked." end - - test "it prints an error message when invite is not exist" do - Mix.Tasks.Pleroma.User.run(["revoke_invite", "foo"]) - - assert_received {:mix_shell, :error, [message]} - assert message =~ "No invite found" - end end describe "running delete_activities" do @@ -464,27 +457,27 @@ test "it prints an error message when user is not exist" do describe "running confirm" do test "user is confirmed" do - %{id: id, nickname: nickname} = insert(:user, confirmation_pending: false) + %{id: id, nickname: nickname} = insert(:user, is_confirmed: true) assert :ok = Mix.Tasks.Pleroma.User.run(["confirm", nickname]) assert_received {:mix_shell, :info, [message]} assert message == "#{nickname} doesn't need confirmation." user = Repo.get(User, id) - refute user.confirmation_pending + assert user.is_confirmed refute user.confirmation_token end test "user is not confirmed" do %{id: id, nickname: nickname} = - insert(:user, confirmation_pending: true, confirmation_token: "some token") + insert(:user, is_confirmed: false, confirmation_token: "some token") assert :ok = Mix.Tasks.Pleroma.User.run(["confirm", nickname]) assert_received {:mix_shell, :info, [message]} assert message == "#{nickname} doesn't need confirmation." user = Repo.get(User, id) - refute user.confirmation_pending + assert user.is_confirmed refute user.confirmation_token end @@ -579,29 +572,29 @@ test "it prints an error message when user is not exist" do describe "bulk confirm and unconfirm" do test "confirm all" do - user1 = insert(:user, confirmation_pending: true) - user2 = insert(:user, confirmation_pending: true) + user1 = insert(:user, is_confirmed: false) + user2 = insert(:user, is_confirmed: false) - assert user1.confirmation_pending - assert user2.confirmation_pending + refute user1.is_confirmed + refute user2.is_confirmed Mix.Tasks.Pleroma.User.run(["confirm_all"]) user1 = User.get_cached_by_nickname(user1.nickname) user2 = User.get_cached_by_nickname(user2.nickname) - refute user1.confirmation_pending - refute user2.confirmation_pending + assert user1.is_confirmed + assert user2.is_confirmed end test "unconfirm all" do - user1 = insert(:user, confirmation_pending: false) - user2 = insert(:user, confirmation_pending: false) - admin = insert(:user, is_admin: true, confirmation_pending: false) - mod = insert(:user, is_moderator: true, confirmation_pending: false) + user1 = insert(:user, is_confirmed: true) + user2 = insert(:user, is_confirmed: true) + admin = insert(:user, is_admin: true, is_confirmed: true) + mod = insert(:user, is_moderator: true, is_confirmed: true) - refute user1.confirmation_pending - refute user2.confirmation_pending + assert user1.is_confirmed + assert user2.is_confirmed Mix.Tasks.Pleroma.User.run(["unconfirm_all"]) @@ -610,10 +603,10 @@ test "unconfirm all" do admin = User.get_cached_by_nickname(admin.nickname) mod = User.get_cached_by_nickname(mod.nickname) - assert user1.confirmation_pending - assert user2.confirmation_pending - refute admin.confirmation_pending - refute mod.confirmation_pending + refute user1.is_confirmed + refute user2.is_confirmed + assert admin.is_confirmed + assert mod.is_confirmed end end end diff --git a/test/pleroma/repo/migrations/confirm_logged_in_users_test.exs b/test/pleroma/repo/migrations/confirm_logged_in_users_test.exs index b30faa257..99d17f62a 100644 --- a/test/pleroma/repo/migrations/confirm_logged_in_users_test.exs +++ b/test/pleroma/repo/migrations/confirm_logged_in_users_test.exs @@ -14,12 +14,12 @@ defmodule Pleroma.Repo.Migrations.ConfirmLoggedInUsersTest do test "up/0 confirms unconfirmed but previously-logged-in users", %{migration: migration} do insert_list(25, :oauth_token) - Repo.update_all(User, set: [confirmation_pending: true]) - insert_list(5, :user, confirmation_pending: true) + Repo.update_all(User, set: [is_confirmed: false]) + insert_list(5, :user, is_confirmed: false) count = User - |> where(confirmation_pending: true) + |> where(is_confirmed: false) |> Repo.aggregate(:count) assert count == 30 @@ -28,7 +28,7 @@ test "up/0 confirms unconfirmed but previously-logged-in users", %{migration: mi count = User - |> where(confirmation_pending: true) + |> where(is_confirmed: false) |> Repo.aggregate(:count) assert count == 5 diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index bdf17e96a..ac9db9ffb 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -640,7 +640,7 @@ test "it creates a confirmed user" do {:ok, user} = Repo.insert(changeset) - refute user.confirmation_pending + assert user.is_confirmed end end @@ -661,17 +661,17 @@ test "it creates unconfirmed user" do {:ok, user} = Repo.insert(changeset) - assert user.confirmation_pending + refute user.is_confirmed assert user.confirmation_token end test "it creates confirmed user if :confirmed option is given" do - changeset = User.register_changeset(%User{}, @full_user_data, need_confirmation: false) + changeset = User.register_changeset(%User{}, @full_user_data, confirmed: true) assert changeset.valid? {:ok, user} = Repo.insert(changeset) - refute user.confirmation_pending + assert user.is_confirmed refute user.confirmation_token end end @@ -1443,17 +1443,17 @@ test "approving an approved user does not trigger post-register actions" do describe "confirm" do test "confirms a user" do - user = insert(:user, confirmation_pending: true) - assert true == user.confirmation_pending + user = insert(:user, is_confirmed: false) + refute user.is_confirmed {:ok, user} = User.confirm(user) - assert false == user.confirmation_pending + assert user.is_confirmed end test "confirms a list of users" do unconfirmed_users = [ - insert(:user, confirmation_pending: true), - insert(:user, confirmation_pending: true), - insert(:user, confirmation_pending: true) + insert(:user, is_confirmed: false), + insert(:user, is_confirmed: false), + insert(:user, is_confirmed: false) ] {:ok, users} = User.confirm(unconfirmed_users) @@ -1461,13 +1461,13 @@ test "confirms a list of users" do assert Enum.count(users) == 3 Enum.each(users, fn user -> - assert false == user.confirmation_pending + assert user.is_confirmed end) end test "sends approval emails when `approval_pending: true`" do admin = insert(:user, is_admin: true) - user = insert(:user, confirmation_pending: true, approval_pending: true) + user = insert(:user, is_confirmed: false, approval_pending: true) User.confirm(user) ObanHelpers.perform_all() @@ -1494,7 +1494,7 @@ test "sends approval emails when `approval_pending: true`" do end test "confirming a confirmed user does not trigger post-register actions" do - user = insert(:user, confirmation_pending: false, approval_pending: true) + user = insert(:user, is_confirmed: true, approval_pending: true) User.confirm(user) ObanHelpers.perform_all() @@ -1565,7 +1565,7 @@ test "it deactivates a user, all follow relationships and all activities", %{use describe "delete/1 when confirmation is pending" do setup do - user = insert(:user, confirmation_pending: true) + user = insert(:user, is_confirmed: false) {:ok, user: user} end @@ -1616,7 +1616,7 @@ test "delete/1 purges a user when they wouldn't be fully deleted" do follower_count: 9, following_count: 9001, is_locked: true, - confirmation_pending: true, + is_confirmed: false, password_reset_pending: true, approval_pending: true, registration_reason: "ahhhhh", @@ -1658,7 +1658,7 @@ test "delete/1 purges a user when they wouldn't be fully deleted" do follower_count: 0, following_count: 0, is_locked: false, - confirmation_pending: false, + is_confirmed: true, password_reset_pending: false, approval_pending: false, registration_reason: nil, @@ -1729,13 +1729,13 @@ test "User.delete() plugs any possible zombie objects" do test "return confirmation_pending for unconfirm user" do Pleroma.Config.put([:instance, :account_activation_required], true) - user = insert(:user, confirmation_pending: true) + user = insert(:user, is_confirmed: false) assert User.account_status(user) == :confirmation_pending end test "return active for confirmed user" do Pleroma.Config.put([:instance, :account_activation_required], true) - user = insert(:user, confirmation_pending: false) + user = insert(:user, is_confirmed: true) assert User.account_status(user) == :active end @@ -1750,7 +1750,7 @@ test "returns :password_reset_pending for user with reset password" do end test "returns :deactivated for deactivated user" do - user = insert(:user, local: true, confirmation_pending: false, deactivated: true) + user = insert(:user, local: true, is_confirmed: true, deactivated: true) assert User.account_status(user) == :deactivated end @@ -1758,7 +1758,7 @@ test "returns :approval_pending for unapproved user" do user = insert(:user, local: true, approval_pending: true) assert User.account_status(user) == :approval_pending - user = insert(:user, local: true, confirmation_pending: true, approval_pending: true) + user = insert(:user, local: true, is_confirmed: false, approval_pending: true) assert User.account_status(user) == :approval_pending end end @@ -1815,7 +1815,7 @@ test "returns true when the account is itself" do test "returns false when the account is unconfirmed and confirmation is required" do Pleroma.Config.put([:instance, :account_activation_required], true) - user = insert(:user, local: true, confirmation_pending: true) + user = insert(:user, local: true, is_confirmed: false) other_user = insert(:user, local: true) refute User.visible_for(user, other_user) == :visible @@ -1824,14 +1824,14 @@ test "returns false when the account is unconfirmed and confirmation is required test "returns true when the account is unconfirmed and confirmation is required but the account is remote" do Pleroma.Config.put([:instance, :account_activation_required], true) - user = insert(:user, local: false, confirmation_pending: true) + user = insert(:user, local: false, is_confirmed: false) other_user = insert(:user, local: true) assert User.visible_for(user, other_user) == :visible end test "returns true when the account is unconfirmed and confirmation is not required" do - user = insert(:user, local: true, confirmation_pending: true) + user = insert(:user, local: true, is_confirmed: false) other_user = insert(:user, local: true) assert User.visible_for(user, other_user) == :visible @@ -1840,7 +1840,7 @@ test "returns true when the account is unconfirmed and confirmation is not requi test "returns true when the account is unconfirmed and being viewed by a privileged account (confirmation required)" do Pleroma.Config.put([:instance, :account_activation_required], true) - user = insert(:user, local: true, confirmation_pending: true) + user = insert(:user, local: true, is_confirmed: false) other_user = insert(:user, local: true, is_admin: true) assert User.visible_for(user, other_user) == :visible diff --git a/test/pleroma/web/activity_pub/side_effects_test.exs b/test/pleroma/web/activity_pub/side_effects_test.exs index 2d94f07c9..e3f45ecdb 100644 --- a/test/pleroma/web/activity_pub/side_effects_test.exs +++ b/test/pleroma/web/activity_pub/side_effects_test.exs @@ -159,7 +159,7 @@ test "creates a notification", %{emoji_react: emoji_react, poster: poster} do describe "delete users with confirmation pending" do setup do - user = insert(:user, confirmation_pending: true) + user = insert(:user, is_confirmed: false) {:ok, delete_user_data, _meta} = Builder.delete(user, user.ap_id) {:ok, delete_user, _meta} = ActivityPub.persist(delete_user_data, local: true) {:ok, delete: delete_user, user: user} diff --git a/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs b/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs index c54402e52..23e4bc3af 100644 --- a/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs @@ -891,10 +891,10 @@ test "GET /instances/:instance/statuses", %{conn: conn} do describe "PATCH /confirm_email" do test "it confirms emails of two users", %{conn: conn, admin: admin} do - [first_user, second_user] = insert_pair(:user, confirmation_pending: true) + [first_user, second_user] = insert_pair(:user, is_confirmed: false) - assert first_user.confirmation_pending == true - assert second_user.confirmation_pending == true + refute first_user.is_confirmed + refute second_user.is_confirmed ret_conn = patch(conn, "/api/pleroma/admin/users/confirm_email", %{ @@ -906,8 +906,11 @@ test "it confirms emails of two users", %{conn: conn, admin: admin} do assert ret_conn.status == 200 - assert first_user.confirmation_pending == true - assert second_user.confirmation_pending == true + first_user = User.get_by_id(first_user.id) + second_user = User.get_by_id(second_user.id) + + assert first_user.is_confirmed + assert second_user.is_confirmed log_entry = Repo.one(ModerationLog) @@ -920,7 +923,7 @@ test "it confirms emails of two users", %{conn: conn, admin: admin} do describe "PATCH /resend_confirmation_email" do test "it resend emails for two users", %{conn: conn, admin: admin} do - [first_user, second_user] = insert_pair(:user, confirmation_pending: true) + [first_user, second_user] = insert_pair(:user, is_confirmed: false) ret_conn = patch(conn, "/api/pleroma/admin/users/resend_confirmation_email", %{ diff --git a/test/pleroma/web/admin_api/controllers/status_controller_test.exs b/test/pleroma/web/admin_api/controllers/status_controller_test.exs index 976990d5c..24e288c5f 100644 --- a/test/pleroma/web/admin_api/controllers/status_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/status_controller_test.exs @@ -48,7 +48,7 @@ test "shows activity", %{conn: conn} do assert account["id"] == actor.id assert account["nickname"] == actor.nickname assert account["deactivated"] == actor.deactivated - assert account["confirmation_pending"] == actor.confirmation_pending + assert account["is_confirmed"] == actor.is_confirmed end end diff --git a/test/pleroma/web/admin_api/controllers/user_controller_test.exs b/test/pleroma/web/admin_api/controllers/user_controller_test.exs index 40d39aae7..569343ed5 100644 --- a/test/pleroma/web/admin_api/controllers/user_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/user_controller_test.exs @@ -635,11 +635,11 @@ test "only local users with no query", %{conn: conn, admin: old_admin} do end test "only unconfirmed users", %{conn: conn} do - sad_user = insert(:user, nickname: "sadboy", confirmation_pending: true) - old_user = insert(:user, nickname: "oldboy", confirmation_pending: true) + sad_user = insert(:user, nickname: "sadboy", is_confirmed: false) + old_user = insert(:user, nickname: "oldboy", is_confirmed: false) insert(:user, nickname: "happyboy", approval_pending: false) - insert(:user, confirmation_pending: false) + insert(:user, is_confirmed: true) result = conn @@ -649,7 +649,7 @@ test "only unconfirmed users", %{conn: conn} do users = Enum.map([old_user, sad_user], fn user -> user_response(user, %{ - "confirmation_pending" => true, + "is_confirmed" => false, "approval_pending" => false }) end) @@ -960,7 +960,7 @@ defp user_response(user, attrs \\ %{}) do "tags" => [], "avatar" => User.avatar_url(user) |> MediaProxy.url(), "display_name" => HTML.strip_tags(user.name || user.nickname), - "confirmation_pending" => false, + "is_confirmed" => true, "approval_pending" => false, "url" => user.ap_id, "registration_reason" => nil, diff --git a/test/pleroma/web/admin_api/search_test.exs b/test/pleroma/web/admin_api/search_test.exs index 307578ae0..913dc374a 100644 --- a/test/pleroma/web/admin_api/search_test.exs +++ b/test/pleroma/web/admin_api/search_test.exs @@ -193,7 +193,7 @@ test "it returns unapproved user" do end test "it returns unconfirmed user" do - unconfirmed = insert(:user, confirmation_pending: true) + unconfirmed = insert(:user, is_confirmed: false) insert(:user) insert(:user) diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index 7b3cc7344..2d929e532 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -1027,7 +1027,7 @@ test "registers and logs in without :account_activation_required / :account_appr user = Repo.preload(token_from_db, :user).user assert user - refute user.confirmation_pending + assert user.is_confirmed refute user.approval_pending end @@ -1088,7 +1088,7 @@ test "registers but does not log in with :account_activation_required", %{conn: refute response["token_type"] user = Repo.get_by(User, email: "lain@example.org") - assert user.confirmation_pending + refute user.is_confirmed end test "registers but does not log in with :account_approval_required", %{conn: conn} do diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index 32fe08196..f4e6c161e 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -79,7 +79,7 @@ test "Represent a user account" do also_known_as: ["https://shitposter.zone/users/shp"], background_image: "https://example.com/images/asuka_hospital.png", favicon: nil, - confirmation_pending: false, + is_confirmed: true, tags: [], is_admin: false, is_moderator: false, @@ -178,7 +178,7 @@ test "Represent a Service(bot) account" do also_known_as: [], background_image: nil, favicon: nil, - confirmation_pending: false, + is_confirmed: true, tags: [], is_admin: false, is_moderator: false, diff --git a/test/pleroma/web/o_auth/o_auth_controller_test.exs b/test/pleroma/web/o_auth/o_auth_controller_test.exs index bf47afed8..337d2650c 100644 --- a/test/pleroma/web/o_auth/o_auth_controller_test.exs +++ b/test/pleroma/web/o_auth/o_auth_controller_test.exs @@ -928,7 +928,7 @@ test "rejects token exchange for valid credentials belonging to unconfirmed user {:ok, user} = insert(:user, password_hash: Pleroma.Password.Pbkdf2.hash_pwd_salt(password)) - |> User.confirmation_changeset(need_confirmation: true) + |> User.confirmation_changeset(set_confirmation: false) |> User.update_and_set_cache() refute Pleroma.User.account_status(user) == :active @@ -1013,7 +1013,7 @@ test "rejects token exchange for user with confirmation_pending set to true" do user = insert(:user, password_hash: Pleroma.Password.Pbkdf2.hash_pwd_salt(password), - confirmation_pending: true + is_confirmed: false ) app = insert(:oauth_app, scopes: ["read", "write"]) diff --git a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs index baf2d01ab..9f14c5577 100644 --- a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs @@ -17,10 +17,10 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do setup do {:ok, user} = insert(:user) - |> User.confirmation_changeset(need_confirmation: true) + |> User.confirmation_changeset(set_confirmation: false) |> User.update_and_set_cache() - assert user.confirmation_pending + refute user.is_confirmed [user: user] end diff --git a/test/pleroma/web/plugs/user_enabled_plug_test.exs b/test/pleroma/web/plugs/user_enabled_plug_test.exs index bee413fbf..6d0f4fb7d 100644 --- a/test/pleroma/web/plugs/user_enabled_plug_test.exs +++ b/test/pleroma/web/plugs/user_enabled_plug_test.exs @@ -22,7 +22,7 @@ test "with a user that's not confirmed and a config requiring confirmation, it r %{conn: conn} do Pleroma.Config.put([:instance, :account_activation_required], true) - user = insert(:user, confirmation_pending: true) + user = insert(:user, is_confirmed: false) conn = conn diff --git a/test/pleroma/web/twitter_api/controller_test.exs b/test/pleroma/web/twitter_api/controller_test.exs index 23884e223..583c904b2 100644 --- a/test/pleroma/web/twitter_api/controller_test.exs +++ b/test/pleroma/web/twitter_api/controller_test.exs @@ -64,10 +64,10 @@ test "with credentials, with params" do setup do {:ok, user} = insert(:user) - |> User.confirmation_changeset(need_confirmation: true) + |> User.confirmation_changeset(set_confirmation: false) |> Repo.update() - assert user.confirmation_pending + refute user.is_confirmed [user: user] end @@ -83,7 +83,7 @@ test "it confirms the user account", %{conn: conn, user: user} do user = User.get_cached_by_id(user.id) - refute user.confirmation_pending + assert user.is_confirmed refute user.confirmation_token end diff --git a/test/pleroma/web/twitter_api/twitter_api_test.exs b/test/pleroma/web/twitter_api/twitter_api_test.exs index 3be4812d3..0ed1389f5 100644 --- a/test/pleroma/web/twitter_api/twitter_api_test.exs +++ b/test/pleroma/web/twitter_api/twitter_api_test.exs @@ -65,7 +65,7 @@ test "it sends confirmation email if :account_activation_required is specified i {:ok, user} = TwitterAPI.register_user(data) ObanHelpers.perform_all() - assert user.confirmation_pending + refute user.is_confirmed email = Pleroma.Emails.UserEmail.account_confirmation_email(user)