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