Pleroma/lib/mix/tasks/rm_user.ex
2018-04-18 17:39:27 +03:00

15 lines
302 B
Elixir

defmodule Mix.Tasks.RmUser do
use Mix.Task
import Mix.Ecto
alias Pleroma.{User, Repo}
@shortdoc "Permanently delete a user"
def run([nickname]) do
ensure_started(Repo, [])
with %User{local: true} = user <- User.get_by_nickname(nickname) do
User.delete(user)
end
end
end