2018-10-30 00:08:56 +01:00
|
|
|
defmodule Mix.Tasks.ReactivateUser do
|
|
|
|
use Mix.Task
|
|
|
|
alias Pleroma.User
|
|
|
|
|
2018-11-08 15:28:50 +01:00
|
|
|
@moduledoc """
|
2018-11-08 15:21:09 +01:00
|
|
|
Reactivate a user
|
|
|
|
|
|
|
|
Usage: ``mix reactivate_user <nickname>``
|
|
|
|
|
|
|
|
Example: ``mix reactivate_user lain``
|
|
|
|
"""
|
2018-10-30 00:08:56 +01:00
|
|
|
def run([nickname]) do
|
|
|
|
Mix.Task.run("app.start")
|
|
|
|
|
|
|
|
with user <- User.get_by_nickname(nickname) do
|
|
|
|
User.deactivate(user, false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|