honkoma/lib/mix/tasks/rm_user.ex

15 lines
303 B
Elixir
Raw Normal View History

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