From cc0756ec5694a84b86d4da7798ce1ce9fc86ef27 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 23 Feb 2021 09:49:27 -0600 Subject: [PATCH] Deleting a user from AdminAPI should use User.delete/1 --- lib/pleroma/web/admin_api/controllers/user_controller.ex | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/pleroma/web/admin_api/controllers/user_controller.ex b/lib/pleroma/web/admin_api/controllers/user_controller.ex index 65bc63cb9..14c76a152 100644 --- a/lib/pleroma/web/admin_api/controllers/user_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/user_controller.ex @@ -10,8 +10,6 @@ defmodule Pleroma.Web.AdminAPI.UserController do alias Pleroma.ModerationLog alias Pleroma.User - alias Pleroma.Web.ActivityPub.Builder - alias Pleroma.Web.ActivityPub.Pipeline alias Pleroma.Web.AdminAPI alias Pleroma.Web.AdminAPI.AccountView alias Pleroma.Web.AdminAPI.Search @@ -53,10 +51,7 @@ defmodule Pleroma.Web.AdminAPI.UserController do def delete(%{assigns: %{user: admin}} = conn, %{"nicknames" => nicknames}) do users = Enum.map(nicknames, &User.get_cached_by_nickname/1) - Enum.each(users, fn user -> - {:ok, delete_data, _} = Builder.delete(admin, user.ap_id) - Pipeline.common_pipeline(delete_data, local: true) - end) + Enum.each(users, &User.delete(&1)) ModerationLog.insert_log(%{ actor: admin,