mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 00:09:35 +00:00
Add rm_user mix task
This commit is contained in:
parent
3d636cf533
commit
4478b9115c
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