Merge branch 'mix_task_rm_user' into 'develop'

Add rm_user mix task

See merge request pleroma/pleroma!109
This commit is contained in:
lambda 2018-04-13 07:43:32 +00:00
commit 3b68eaa0ce
1 changed files with 14 additions and 0 deletions

14
lib/mix/tasks/rm_user.ex Normal file
View 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