2018-04-12 02:43:48 -04:00
|
|
|
defmodule Mix.Tasks.RmUser do
|
|
|
|
use Mix.Task
|
|
|
|
import Mix.Ecto
|
2018-04-18 10:39:27 -04:00
|
|
|
alias Pleroma.{User, Repo}
|
2018-04-12 02:43:48 -04:00
|
|
|
|
|
|
|
@shortdoc "Permanently delete a user"
|
|
|
|
def run([nickname]) do
|
2018-04-18 10:52:25 -04:00
|
|
|
Mix.Task.run("app.start")
|
2018-04-12 02:43:48 -04:00
|
|
|
|
|
|
|
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
2018-04-18 10:39:27 -04:00
|
|
|
User.delete(user)
|
2018-04-12 02:43:48 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|