forked from AkkomaGang/akkoma
Merge branch 'mix_task_rm_user' into 'develop'
Add rm_user mix task See merge request pleroma/pleroma!109
This commit is contained in:
commit
3b68eaa0ce
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.User
|
||||||
|
|
||||||
|
@shortdoc "Permanently delete a user"
|
||||||
|
def run([nickname]) do
|
||||||
|
ensure_started(Repo, [])
|
||||||
|
|
||||||
|
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
||||||
|
user.delete()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue