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