aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks/set_locked.ex
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-04-17 12:22:32 +0300
committerrinpatch <rinpatch@sdf.org>2019-04-17 12:22:32 +0300
commit627e5a0a4992cc19fc65a7e93a09c470c8e2bf33 (patch)
tree0f38b475e8554863a1cbbd7750c19d4cd1336eb1 /lib/mix/tasks/set_locked.ex
parentd6ab701a14f7c9fb4d59953648c425e04725fc62 (diff)
parent73df3046e014ae16e03f16a9c82921652cefcb54 (diff)
downloadpleroma-627e5a0a4992cc19fc65a7e93a09c470c8e2bf33.tar.gz
Merge branch 'develop' into feature/database-compaction
Diffstat (limited to 'lib/mix/tasks/set_locked.ex')
-rw-r--r--lib/mix/tasks/set_locked.ex39
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/mix/tasks/set_locked.ex b/lib/mix/tasks/set_locked.ex
deleted file mode 100644
index a154595ca..000000000
--- a/lib/mix/tasks/set_locked.ex
+++ /dev/null
@@ -1,39 +0,0 @@
-defmodule Mix.Tasks.SetLocked do
- @moduledoc """
- Lock a local user
-
- The local user will then have to manually accept/reject followers. This can also be done by the user into their settings.
-
- Usage: ``mix set_locked <username>``
-
- Example: ``mix set_locked lain``
- """
-
- use Mix.Task
- import Mix.Ecto
- alias Pleroma.{Repo, User}
-
- def run([nickname | rest]) do
- ensure_started(Repo, [])
-
- locked =
- case rest do
- [locked] -> locked == "true"
- _ -> true
- end
-
- with %User{local: true} = user <- User.get_by_nickname(nickname) do
- info =
- user.info
- |> Map.put("locked", !!locked)
-
- cng = User.info_changeset(user, %{info: info})
- user = Repo.update!(cng)
-
- IO.puts("locked status of #{nickname}: #{user.info["locked"]}")
- else
- _ ->
- IO.puts("No local user #{nickname}")
- end
- end
-end