mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
add mix task for deactivating a user by nickname
This commit is contained in:
parent
9390492138
commit
a6a6915aaf
1 changed files with 13 additions and 0 deletions
13
lib/mix/tasks/deactivate_user.ex
Normal file
13
lib/mix/tasks/deactivate_user.ex
Normal 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
|
Loading…
Reference in a new issue