Pleroma user.rm mix task should also call User.delete/1

This commit is contained in:
Mark Felder 2021-02-23 10:59:02 -06:00
parent 14c8912221
commit 0714f1c440

View File

@ -8,8 +8,6 @@ defmodule Mix.Tasks.Pleroma.User do
alias Ecto.Changeset
alias Pleroma.User
alias Pleroma.UserInviteToken
alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.Pipeline
@shortdoc "Manages Pleroma users"
@moduledoc File.read!("docs/administration/CLI_tasks/user.md")
@ -98,9 +96,8 @@ defmodule Mix.Tasks.Pleroma.User do
def run(["rm", nickname]) do
start_pleroma()
with %User{local: true} = user <- User.get_cached_by_nickname(nickname),
{:ok, delete_data, _} <- Builder.delete(user, user.ap_id),
{:ok, _delete, _} <- Pipeline.common_pipeline(delete_data, local: true) do
with %User{local: true} = user <- User.get_cached_by_nickname(nickname) do
User.delete(user)
shell_info("User #{nickname} deleted.")
else
_ -> shell_error("No local user #{nickname}")