From: William Pitcock Date: Sun, 13 May 2018 23:33:43 +0000 (+0000) Subject: add mix task for deactivating a user by nickname X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=a6a6915aaf568dda8b784438b963e341c2fc0f29;p=akkoma add mix task for deactivating a user by nickname --- diff --git a/lib/mix/tasks/deactivate_user.ex b/lib/mix/tasks/deactivate_user.ex new file mode 100644 index 000000000..96b3db6e4 --- /dev/null +++ b/lib/mix/tasks/deactivate_user.ex @@ -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