2018-05-13 19:33:43 -04:00
|
|
|
defmodule Mix.Tasks.DeactivateUser do
|
|
|
|
use Mix.Task
|
|
|
|
alias Pleroma.User
|
|
|
|
|
2018-11-02 04:32:48 -04:00
|
|
|
@moduledoc """
|
|
|
|
Deactivates a user (local or remote)
|
|
|
|
|
|
|
|
Usage: ``mix deactivate_user <nickname>``
|
|
|
|
|
|
|
|
Example: ``mix deactivate_user lain``
|
|
|
|
"""
|
2018-05-13 19:33:43 -04:00
|
|
|
def run([nickname]) do
|
|
|
|
Mix.Task.run("app.start")
|
|
|
|
|
|
|
|
with user <- User.get_by_nickname(nickname) do
|
|
|
|
User.deactivate(user)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|