add mix task for deactivating a user by nickname

This commit is contained in:
William Pitcock 2018-05-13 23:33:43 +00:00
parent 9390492138
commit a6a6915aaf

View file

@ -0,0 +1,13 @@
defmodule Mix.Tasks.DeactivateUser do
use Mix.Task
alias Pleroma.User
@shortdoc "Toggle deactivation status for a user"
def run([nickname]) do
Mix.Task.run("app.start")
with user <- User.get_by_nickname(nickname) do
User.deactivate(user)
end
end
end