diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff37d3021..50d5f80e3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **Breaking:** Changed `mix pleroma.user toggle_confirmed` to `mix pleroma.user confirm`
- **Breaking**: AdminAPI changed User field `confirmation_pending` to `is_confirmed`
+- **Breaking**: AdminAPI changed User field `approval_pending` to `is_approved`
- 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.
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 9efc27887..d81abbd2b 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -112,7 +112,7 @@ defmodule Pleroma.User do
field(:is_locked, :boolean, default: false)
field(:is_confirmed, :boolean, default: true)
field(:password_reset_pending, :boolean, default: false)
- field(:approval_pending, :boolean, default: false)
+ field(:is_approved, :boolean, default: true)
field(:registration_reason, :string, default: nil)
field(:confirmation_token, :string, default: nil)
field(:default_scope, :string, default: "public")
@@ -288,7 +288,7 @@ def binary_id(%User{} = user), do: binary_id(user.id)
@spec account_status(User.t()) :: account_status()
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, is_approved: false}), do: :approval_pending
def account_status(%User{local: true, is_confirmed: false}) do
if Config.get([:instance, :account_activation_required]) do
@@ -711,16 +711,16 @@ def register_changeset(struct, params \\ %{}, opts \\ []) do
opts[:confirmed]
end
- need_approval? =
- if is_nil(opts[:need_approval]) do
- Config.get([:instance, :account_approval_required])
+ approved? =
+ if is_nil(opts[:approved]) do
+ !Config.get([:instance, :account_approval_required])
else
- opts[:need_approval]
+ opts[:approved]
end
struct
|> confirmation_changeset(set_confirmation: confirmed?)
- |> approval_changeset(need_approval: need_approval?)
+ |> approval_changeset(set_approval: approved?)
|> cast(params, [
:bio,
:raw_bio,
@@ -814,14 +814,14 @@ def post_register_action(%User{is_confirmed: false} = user) do
end
end
- def post_register_action(%User{approval_pending: true} = user) do
+ def post_register_action(%User{is_approved: false} = user) do
with {:ok, _} <- send_user_approval_email(user),
{:ok, _} <- send_admin_approval_emails(user) do
{:ok, user}
end
end
- def post_register_action(%User{approval_pending: false, is_confirmed: true} = user) do
+ def post_register_action(%User{is_approved: true, is_confirmed: true} = user) do
with {:ok, user} <- autofollow_users(user),
{:ok, _} <- autofollowing_users(user),
{:ok, user} <- set_cache(user),
@@ -1624,8 +1624,8 @@ def approve(users) when is_list(users) do
end)
end
- def approve(%User{approval_pending: true} = user) do
- with chg <- change(user, approval_pending: false),
+ def approve(%User{is_approved: false} = user) do
+ with chg <- change(user, is_approved: true),
{:ok, user} <- update_and_set_cache(chg) do
post_register_action(user)
{:ok, user}
@@ -1684,7 +1684,7 @@ def purge_user_changeset(user) do
is_locked: false,
is_confirmed: true,
password_reset_pending: false,
- approval_pending: false,
+ is_approved: true,
registration_reason: nil,
confirmation_token: nil,
domain_blocks: [],
@@ -2327,9 +2327,8 @@ def confirmation_changeset(user, set_confirmation: confirmed?) do
end
@spec approval_changeset(User.t(), keyword()) :: Changeset.t()
- def approval_changeset(user, need_approval: need_approval?) do
- params = if need_approval?, do: %{approval_pending: true}, else: %{approval_pending: false}
- cast(user, params, [:approval_pending])
+ def approval_changeset(user, set_approval: approved?) do
+ cast(user, %{is_approved: approved?}, [:is_approved])
end
def add_pinnned_activity(user, %Pleroma.Activity{id: id}) do
diff --git a/lib/pleroma/user/query.ex b/lib/pleroma/user/query.ex
index 481c41d8c..74ef1158a 100644
--- a/lib/pleroma/user/query.ex
+++ b/lib/pleroma/user/query.ex
@@ -138,7 +138,7 @@ defp compose_query({:external, _}, query), do: location_query(query, false)
defp compose_query({:active, _}, query) do
User.restrict_deactivated(query)
- |> where([u], u.approval_pending == false)
+ |> where([u], u.is_approved == true)
end
defp compose_query({:legacy_active, _}, query) do
@@ -159,7 +159,7 @@ defp compose_query({:confirmation_pending, bool}, query) do
end
defp compose_query({:need_approval, _}, query) do
- where(query, [u], u.approval_pending)
+ where(query, [u], u.is_approved == false)
end
defp compose_query({:unconfirmed, _}, 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 10d2e698b..34bf2e67a 100644
--- a/lib/pleroma/web/admin_api/views/account_view.ex
+++ b/lib/pleroma/web/admin_api/views/account_view.ex
@@ -78,7 +78,7 @@ def render("show.json", %{user: user}) do
"roles" => User.roles(user),
"tags" => user.tags || [],
"is_confirmed" => user.is_confirmed,
- "approval_pending" => user.approval_pending,
+ "is_approved" => user.is_approved,
"url" => user.uri || user.ap_id,
"registration_reason" => user.registration_reason,
"actor_type" => user.actor_type
diff --git a/priv/repo/migrations/20201016205220_refactor_approval_pending_user_field.exs b/priv/repo/migrations/20201016205220_refactor_approval_pending_user_field.exs
new file mode 100644
index 000000000..944dcf8de
--- /dev/null
+++ b/priv/repo/migrations/20201016205220_refactor_approval_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.RefactorApprovalPendingUserField do
+ use Ecto.Migration
+
+ def up do
+ # Flip the values before we change the meaning of the column
+ execute("UPDATE users SET approval_pending = NOT approval_pending;")
+ execute("ALTER TABLE users RENAME COLUMN approval_pending TO is_approved;")
+ execute("ALTER TABLE users ALTER COLUMN is_approved SET DEFAULT true;")
+ end
+
+ def down do
+ execute("UPDATE users SET is_approved = NOT is_approved;")
+ execute("ALTER TABLE users RENAME COLUMN is_approved TO approval_pending;")
+ execute("ALTER TABLE users ALTER COLUMN approval_pending SET DEFAULT false;")
+ end
+end
diff --git a/priv/static/adminfe/chunk-50ba.6e4bf9f4.css b/priv/static/adminfe/chunk-1e46.0411a9b2.css
similarity index 53%
rename from priv/static/adminfe/chunk-50ba.6e4bf9f4.css
rename to priv/static/adminfe/chunk-1e46.0411a9b2.css
index db662fad6..e511ebfe2 100644
Binary files a/priv/static/adminfe/chunk-50ba.6e4bf9f4.css and b/priv/static/adminfe/chunk-1e46.0411a9b2.css differ
diff --git a/priv/static/adminfe/index.html b/priv/static/adminfe/index.html
index 693b13e41..9f6674b5c 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.01bfc983.js
similarity index 63%
rename from priv/static/adminfe/static/js/app.3e54b198.js
rename to priv/static/adminfe/static/js/app.01bfc983.js
index 1bd1760ec..b55da9cda 100644
Binary files a/priv/static/adminfe/static/js/app.3e54b198.js and b/priv/static/adminfe/static/js/app.01bfc983.js differ
diff --git a/priv/static/adminfe/static/js/app.01bfc983.js.map b/priv/static/adminfe/static/js/app.01bfc983.js.map
new file mode 100644
index 000000000..19960bd78
Binary files /dev/null and b/priv/static/adminfe/static/js/app.01bfc983.js.map differ
diff --git a/priv/static/adminfe/static/js/app.3e54b198.js.map b/priv/static/adminfe/static/js/app.3e54b198.js.map
deleted file mode 100644
index 4c682a65c..000000000
Binary files a/priv/static/adminfe/static/js/app.3e54b198.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-1e46.7c2ee531.js b/priv/static/adminfe/static/js/chunk-1e46.7c2ee531.js
new file mode 100644
index 000000000..bdd6fde97
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-1e46.7c2ee531.js differ
diff --git a/priv/static/adminfe/static/js/chunk-1e46.7c2ee531.js.map b/priv/static/adminfe/static/js/chunk-1e46.7c2ee531.js.map
new file mode 100644
index 000000000..305fa838d
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-1e46.7c2ee531.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-35b1.51b3140e.js b/priv/static/adminfe/static/js/chunk-35b1.51b3140e.js
deleted file mode 100644
index 525814336..000000000
Binary files a/priv/static/adminfe/static/js/chunk-35b1.51b3140e.js and /dev/null 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
deleted file mode 100644
index 92b6cece6..000000000
Binary files a/priv/static/adminfe/static/js/chunk-35b1.51b3140e.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-35b1.ddb9524c.js b/priv/static/adminfe/static/js/chunk-35b1.ddb9524c.js
new file mode 100644
index 000000000..f31565f8f
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-35b1.ddb9524c.js differ
diff --git a/priv/static/adminfe/static/js/chunk-35b1.ddb9524c.js.map b/priv/static/adminfe/static/js/chunk-35b1.ddb9524c.js.map
new file mode 100644
index 000000000..7a2659f62
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-35b1.ddb9524c.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
deleted file mode 100644
index 34fa95e8b..000000000
Binary files a/priv/static/adminfe/static/js/chunk-50ba.afb924bf.js and /dev/null 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
deleted file mode 100644
index 909103765..000000000
Binary files a/priv/static/adminfe/static/js/chunk-50ba.afb924bf.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-606c.35588dea.js b/priv/static/adminfe/static/js/chunk-606c.35588dea.js
new file mode 100644
index 000000000..4cffaa5ce
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-606c.35588dea.js differ
diff --git a/priv/static/adminfe/static/js/chunk-606c.35588dea.js.map b/priv/static/adminfe/static/js/chunk-606c.35588dea.js.map
new file mode 100644
index 000000000..603c0fce4
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-606c.35588dea.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
deleted file mode 100644
index 3bd1f7001..000000000
Binary files a/priv/static/adminfe/static/js/chunk-606c.f5585a4f.js and /dev/null 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
deleted file mode 100644
index 48434d04e..000000000
Binary files a/priv/static/adminfe/static/js/chunk-606c.f5585a4f.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-7041.9658c334.js b/priv/static/adminfe/static/js/chunk-7041.1495e01c.js
similarity index 79%
rename from priv/static/adminfe/static/js/chunk-7041.9658c334.js
rename to priv/static/adminfe/static/js/chunk-7041.1495e01c.js
index 837b3a897..e68346c2b 100644
Binary files a/priv/static/adminfe/static/js/chunk-7041.9658c334.js and b/priv/static/adminfe/static/js/chunk-7041.1495e01c.js differ
diff --git a/priv/static/adminfe/static/js/chunk-7041.1495e01c.js.map b/priv/static/adminfe/static/js/chunk-7041.1495e01c.js.map
new file mode 100644
index 000000000..9609e9b1b
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-7041.1495e01c.js.map 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
deleted file mode 100644
index c02d84217..000000000
Binary files a/priv/static/adminfe/static/js/chunk-7041.9658c334.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/runtime.52fd11cf.js b/priv/static/adminfe/static/js/runtime.52fd11cf.js
deleted file mode 100644
index 6be53974a..000000000
Binary files a/priv/static/adminfe/static/js/runtime.52fd11cf.js and /dev/null differ
diff --git a/priv/static/adminfe/static/js/runtime.5c1034c4.js b/priv/static/adminfe/static/js/runtime.5c1034c4.js
new file mode 100644
index 000000000..7d2f6d83b
Binary files /dev/null and b/priv/static/adminfe/static/js/runtime.5c1034c4.js differ
diff --git a/priv/static/adminfe/static/js/runtime.52fd11cf.js.map b/priv/static/adminfe/static/js/runtime.5c1034c4.js.map
similarity index 96%
rename from priv/static/adminfe/static/js/runtime.52fd11cf.js.map
rename to priv/static/adminfe/static/js/runtime.5c1034c4.js.map
index 56adfca2a..723da6ee7 100644
Binary files a/priv/static/adminfe/static/js/runtime.52fd11cf.js.map and b/priv/static/adminfe/static/js/runtime.5c1034c4.js.map differ
diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs
index ac9db9ffb..617d9b755 100644
--- a/test/pleroma/user_test.exs
+++ b/test/pleroma/user_test.exs
@@ -694,7 +694,7 @@ test "it creates unapproved user" do
{:ok, user} = Repo.insert(changeset)
- assert user.approval_pending
+ refute user.is_approved
assert user.registration_reason == "I'm a cool guy :)"
end
@@ -1388,17 +1388,17 @@ test "hide a user's statuses from timelines and notifications" do
describe "approve" do
test "approves a user" do
- user = insert(:user, approval_pending: true)
- assert true == user.approval_pending
+ user = insert(:user, is_approved: false)
+ refute user.is_approved
{:ok, user} = User.approve(user)
- assert false == user.approval_pending
+ assert user.is_approved
end
test "approves a list of users" do
unapproved_users = [
- insert(:user, approval_pending: true),
- insert(:user, approval_pending: true),
- insert(:user, approval_pending: true)
+ insert(:user, is_approved: false),
+ insert(:user, is_approved: false),
+ insert(:user, is_approved: false)
]
{:ok, users} = User.approve(unapproved_users)
@@ -1406,7 +1406,7 @@ test "approves a list of users" do
assert Enum.count(users) == 3
Enum.each(users, fn user ->
- assert false == user.approval_pending
+ assert user.is_approved
end)
end
@@ -1414,7 +1414,7 @@ test "it sends welcome email if it is set" do
clear_config([:welcome, :email, :enabled], true)
clear_config([:welcome, :email, :sender], "tester@test.me")
- user = insert(:user, approval_pending: true)
+ user = insert(:user, is_approved: false)
welcome_user = insert(:user, email: "tester@test.me")
instance_name = Pleroma.Config.get([:instance, :name])
@@ -1432,7 +1432,7 @@ test "it sends welcome email if it is set" do
test "approving an approved user does not trigger post-register actions" do
clear_config([:welcome, :email, :enabled], true)
- user = insert(:user, approval_pending: false)
+ user = insert(:user, is_approved: true)
User.approve(user)
ObanHelpers.perform_all()
@@ -1465,9 +1465,9 @@ test "confirms a list of users" do
end)
end
- test "sends approval emails when `approval_pending: true`" do
+ test "sends approval emails when `is_approved: false`" do
admin = insert(:user, is_admin: true)
- user = insert(:user, is_confirmed: false, approval_pending: true)
+ user = insert(:user, is_confirmed: false, is_approved: false)
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, is_confirmed: true, approval_pending: true)
+ user = insert(:user, is_confirmed: true, is_approved: false)
User.confirm(user)
ObanHelpers.perform_all()
@@ -1591,7 +1591,7 @@ test "deactivates user when activation is not required", %{user: user} do
end
test "delete/1 when approval is pending deletes the user" do
- user = insert(:user, approval_pending: true)
+ user = insert(:user, is_approved: false)
{:ok, job} = User.delete(user)
{:ok, _} = ObanHelpers.perform(job)
@@ -1618,7 +1618,7 @@ test "delete/1 purges a user when they wouldn't be fully deleted" do
is_locked: true,
is_confirmed: false,
password_reset_pending: true,
- approval_pending: true,
+ is_approved: false,
registration_reason: "ahhhhh",
confirmation_token: "qqqq",
domain_blocks: ["lain.com"],
@@ -1660,7 +1660,7 @@ test "delete/1 purges a user when they wouldn't be fully deleted" do
is_locked: false,
is_confirmed: true,
password_reset_pending: false,
- approval_pending: false,
+ is_approved: true,
registration_reason: nil,
confirmation_token: nil,
domain_blocks: [],
@@ -1755,10 +1755,10 @@ test "returns :deactivated for deactivated user" do
end
test "returns :approval_pending for unapproved user" do
- user = insert(:user, local: true, approval_pending: true)
+ user = insert(:user, local: true, is_approved: false)
assert User.account_status(user) == :approval_pending
- user = insert(:user, local: true, is_confirmed: false, approval_pending: true)
+ user = insert(:user, local: true, is_confirmed: false, is_approved: false)
assert User.account_status(user) == :approval_pending
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 569343ed5..7f37247a9 100644
--- a/test/pleroma/web/admin_api/controllers/user_controller_test.exs
+++ b/test/pleroma/web/admin_api/controllers/user_controller_test.exs
@@ -429,7 +429,7 @@ test "allows to force-unfollow another user", %{admin: admin, conn: conn} do
describe "GET /api/pleroma/admin/users" do
test "renders users array for the first page", %{conn: conn, admin: admin} do
user = insert(:user, local: false, tags: ["foo", "bar"])
- user2 = insert(:user, approval_pending: true, registration_reason: "I'm a chill dude")
+ user2 = insert(:user, is_approved: false, registration_reason: "I'm a chill dude")
conn = get(conn, "/api/pleroma/admin/users?page=1")
@@ -444,7 +444,7 @@ test "renders users array for the first page", %{conn: conn, admin: admin} do
user2,
%{
"local" => true,
- "approval_pending" => true,
+ "is_approved" => false,
"registration_reason" => "I'm a chill dude",
"actor_type" => "Person"
}
@@ -638,7 +638,7 @@ test "only unconfirmed users", %{conn: conn} do
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, nickname: "happyboy", is_approved: true)
insert(:user, is_confirmed: true)
result =
@@ -650,7 +650,7 @@ test "only unconfirmed users", %{conn: conn} do
Enum.map([old_user, sad_user], fn user ->
user_response(user, %{
"is_confirmed" => false,
- "approval_pending" => false
+ "is_approved" => true
})
end)
|> Enum.sort_by(& &1["nickname"])
@@ -662,18 +662,18 @@ test "only unapproved users", %{conn: conn} do
user =
insert(:user,
nickname: "sadboy",
- approval_pending: true,
+ is_approved: false,
registration_reason: "Plz let me in!"
)
- insert(:user, nickname: "happyboy", approval_pending: false)
+ insert(:user, nickname: "happyboy", is_approved: true)
conn = get(conn, "/api/pleroma/admin/users?filters=need_approval")
users = [
user_response(
user,
- %{"approval_pending" => true, "registration_reason" => "Plz let me in!"}
+ %{"is_approved" => false, "registration_reason" => "Plz let me in!"}
)
]
@@ -816,8 +816,8 @@ test "load users with tags list", %{conn: conn} do
end
test "`active` filters out users pending approval", %{token: token} do
- insert(:user, approval_pending: true)
- %{id: user_id} = insert(:user, approval_pending: false)
+ insert(:user, is_approved: false)
+ %{id: user_id} = insert(:user, is_approved: true)
%{id: admin_id} = token.user
conn =
@@ -913,8 +913,8 @@ test "PATCH /api/pleroma/admin/users/deactivate", %{admin: admin, conn: conn} do
end
test "PATCH /api/pleroma/admin/users/approve", %{admin: admin, conn: conn} do
- user_one = insert(:user, approval_pending: true)
- user_two = insert(:user, approval_pending: true)
+ user_one = insert(:user, is_approved: false)
+ user_two = insert(:user, is_approved: false)
conn =
patch(
@@ -924,7 +924,7 @@ test "PATCH /api/pleroma/admin/users/approve", %{admin: admin, conn: conn} do
)
response = json_response(conn, 200)
- assert Enum.map(response["users"], & &1["approval_pending"]) == [false, false]
+ assert Enum.map(response["users"], & &1["is_approved"]) == [true, true]
log_entry = Repo.one(ModerationLog)
@@ -961,7 +961,7 @@ defp user_response(user, attrs \\ %{}) do
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
"is_confirmed" => true,
- "approval_pending" => false,
+ "is_approved" => true,
"url" => user.ap_id,
"registration_reason" => nil,
"actor_type" => "Person"
diff --git a/test/pleroma/web/admin_api/search_test.exs b/test/pleroma/web/admin_api/search_test.exs
index 913dc374a..438ffa779 100644
--- a/test/pleroma/web/admin_api/search_test.exs
+++ b/test/pleroma/web/admin_api/search_test.exs
@@ -182,7 +182,7 @@ test "it returns user by email" do
end
test "it returns unapproved user" do
- unapproved = insert(:user, approval_pending: true)
+ unapproved = insert(:user, is_approved: 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 2d929e532..2f5bfda98 100644
--- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
@@ -1028,7 +1028,7 @@ test "registers and logs in without :account_activation_required / :account_appr
assert user
assert user.is_confirmed
- refute user.approval_pending
+ assert user.is_approved
end
test "registers but does not log in with :account_activation_required", %{conn: conn} do
@@ -1150,7 +1150,7 @@ test "registers but does not log in with :account_approval_required", %{conn: co
user = Repo.get_by(User, email: "lain@example.org")
- assert user.approval_pending
+ refute user.is_approved
assert user.registration_reason == "I'm a cool dude, bro"
end
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 337d2650c..64ee11890 100644
--- a/test/pleroma/web/o_auth/o_auth_controller_test.exs
+++ b/test/pleroma/web/o_auth/o_auth_controller_test.exs
@@ -1041,7 +1041,7 @@ test "rejects token exchange for valid credentials belonging to an unapproved us
user =
insert(:user,
password_hash: Pleroma.Password.Pbkdf2.hash_pwd_salt(password),
- approval_pending: true
+ is_approved: false
)
refute Pleroma.User.account_status(user) == :active
diff --git a/test/pleroma/web/twitter_api/twitter_api_test.exs b/test/pleroma/web/twitter_api/twitter_api_test.exs
index 0ed1389f5..129ffdf4d 100644
--- a/test/pleroma/web/twitter_api/twitter_api_test.exs
+++ b/test/pleroma/web/twitter_api/twitter_api_test.exs
@@ -97,7 +97,7 @@ test "it sends an admin email if :account_approval_required is specified in inst
{:ok, user} = TwitterAPI.register_user(data)
ObanHelpers.perform_all()
- assert user.approval_pending
+ refute user.is_approved
user_email = Pleroma.Emails.UserEmail.approval_pending_email(user)
admin_email = Pleroma.Emails.AdminEmail.new_unapproved_registration(admin, user)