diff options
author | Phenethylamine <phenethylamine@tutanota.com> | 2018-04-12 02:43:48 -0400 |
---|---|---|
committer | Phenethylamine <phenethylamine@tutanota.com> | 2018-04-12 02:43:48 -0400 |
commit | 4478b9115c088c637721ed2c3255222ec4cf54e2 (patch) | |
tree | 74e4f78065284508d790f3c5a45d33a4becdaea3 /lib | |
parent | 3d636cf533e7e73f35d1837bcc70e8d9f4306b37 (diff) | |
download | pleroma-4478b9115c088c637721ed2c3255222ec4cf54e2.tar.gz |
Add rm_user mix task
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mix/tasks/rm_user.ex | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/mix/tasks/rm_user.ex b/lib/mix/tasks/rm_user.ex new file mode 100644 index 000000000..30196d502 --- /dev/null +++ b/lib/mix/tasks/rm_user.ex @@ -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 |