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