Add rm_user mix task
This commit is contained in:
parent
3d636cf533
commit
4478b9115c
1 changed files with 14 additions and 0 deletions
14
lib/mix/tasks/rm_user.ex
Normal file
14
lib/mix/tasks/rm_user.ex
Normal file
|
@ -0,0 +1,14 @@
|
|||
defmodule Mix.Tasks.RmUser do
|
||||
use Mix.Task
|
||||
import Mix.Ecto
|
||||
alias Pleroma.{Repo, User}
|
||||
|
||||
@shortdoc "Permanently delete a user"
|
||||
def run([nickname]) do
|
||||
ensure_started(Repo, [])
|
||||
|
||||
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
||||
Repo.delete!(user)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue