akkoma/lib/mix/tasks/rm_user.ex

14 lines
288 B
Elixir
Raw Normal View History

2018-04-12 06:43:48 +00:00
defmodule Mix.Tasks.RmUser do
use Mix.Task
2018-05-04 21:25:31 +00:00
alias Pleroma.User
2018-04-12 06:43:48 +00:00
@shortdoc "Permanently delete a user"
def run([nickname]) do
Mix.Task.run("app.start")
2018-04-12 06:43:48 +00:00
with %User{local: true} = user <- User.get_by_nickname(nickname) do
{:ok, _} = User.delete(user)
2018-04-12 06:43:48 +00:00
end
end
end