diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 89a95c435..1457c002c 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1787,7 +1787,10 @@ def set_activation_async(user, status \\ true) do @spec set_activation([User.t()], boolean()) :: {:ok, User.t()} | {:error, Ecto.Changeset.t()} def set_activation(users, status) when is_list(users) do Repo.transaction(fn -> - for user <- users, do: set_activation(user, status) + for user <- users do + {:ok, user} = set_activation(user, status) + user + end end) end diff --git a/lib/pleroma/web/admin_api/controllers/user_controller.ex b/lib/pleroma/web/admin_api/controllers/user_controller.ex index 3de728ebf..cca7d8c2f 100644 --- a/lib/pleroma/web/admin_api/controllers/user_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/user_controller.ex @@ -212,7 +212,7 @@ def activate(%{assigns: %{user: admin}, body_params: %{"nicknames" => nicknames} action: "activate" }) - render(conn, "index.json", users: Keyword.values(updated_users)) + render(conn, "index.json", users: updated_users) end def deactivate(%{assigns: %{user: admin}, body_params: %{"nicknames" => nicknames}} = conn, _) do @@ -225,7 +225,7 @@ def deactivate(%{assigns: %{user: admin}, body_params: %{"nicknames" => nickname action: "deactivate" }) - render(conn, "index.json", users: Keyword.values(updated_users)) + render(conn, "index.json", users: updated_users) end def approve(%{assigns: %{user: admin}, body_params: %{"nicknames" => nicknames}} = conn, _) do