Merge branch 'fix/rm-user-task' into 'develop'

Fix rm_user task.

See merge request pleroma/pleroma!119
This commit is contained in:
lambda 2018-04-18 14:41:03 +00:00
commit 8b5ea91f68

View File

@ -1,14 +1,14 @@
defmodule Mix.Tasks.RmUser do defmodule Mix.Tasks.RmUser do
use Mix.Task use Mix.Task
import Mix.Ecto import Mix.Ecto
alias Pleroma.User alias Pleroma.{User, Repo}
@shortdoc "Permanently delete a user" @shortdoc "Permanently delete a user"
def run([nickname]) do def run([nickname]) do
ensure_started(Repo, []) ensure_started(Repo, [])
with %User{local: true} = user <- User.get_by_nickname(nickname) do with %User{local: true} = user <- User.get_by_nickname(nickname) do
user.delete() User.delete(user)
end end
end end
end end