with %User{local: true} = user <- User.get_by_nickname(nickname) do
info_cng = User.Info.admin_api_update(user.info, %{is_moderator: !!moderator})
- user_cng = Ecto.Changeset.change(user)
- |> put_embed(:info, info_cng)
+
+ user_cng =
+ Ecto.Changeset.change(user)
+ |> put_embed(:info, info_cng)
+
{:ok, user} = User.update_and_set_cache(user_cng)
IO.puts("Moderator status of #{nickname}: #{user.info.is_moderator}")
with %User{local: true} = user <- User.get_by_nickname(nickname) do
info_cng = User.Info.admin_api_update(user.info, %{is_admin: !!admin})
- user_cng = Ecto.Changeset.change(user)
- |> put_embed(:info, info_cng)
+
+ user_cng =
+ Ecto.Changeset.change(user)
+ |> put_embed(:info, info_cng)
+
{:ok, user} = User.update_and_set_cache(user_cng)
IO.puts("Admin status of #{nickname}: #{user.info.is_admin}")
Example: ``mix set_locked lain``
"""
-
+
use Mix.Task
import Ecto.Changeset
alias Pleroma.{Repo, User}
with %User{local: true} = user <- User.get_by_nickname(nickname) do
info_cng = User.Info.profile_update(user.info, %{locked: !!locked})
- user_cng = Ecto.Changeset.change(user)
- |> put_embed(:info, info_cng)
+
+ user_cng =
+ Ecto.Changeset.change(user)
+ |> put_embed(:info, info_cng)
+
{:ok, user} = User.update_and_set_cache(user_cng)
IO.puts("Locked status of #{nickname}: #{user.info.locked}")