mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-23 15:55:04 +01:00
add mix task for deactivating a user by nickname
This commit is contained in:
parent
9390492138
commit
a6a6915aaf
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 New Issue
Block a user