forked from AkkomaGang/akkoma
Sorry
This commit is contained in:
parent
5427d2af3a
commit
c3519132df
3 changed files with 16 additions and 7 deletions
|
@ -22,8 +22,11 @@ def run([nickname | rest]) do
|
||||||
|
|
||||||
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
||||||
info_cng = User.Info.admin_api_update(user.info, %{is_moderator: !!moderator})
|
info_cng = User.Info.admin_api_update(user.info, %{is_moderator: !!moderator})
|
||||||
user_cng = Ecto.Changeset.change(user)
|
|
||||||
|
user_cng =
|
||||||
|
Ecto.Changeset.change(user)
|
||||||
|> put_embed(:info, info_cng)
|
|> put_embed(:info, info_cng)
|
||||||
|
|
||||||
{:ok, user} = User.update_and_set_cache(user_cng)
|
{:ok, user} = User.update_and_set_cache(user_cng)
|
||||||
|
|
||||||
IO.puts("Moderator status of #{nickname}: #{user.info.is_moderator}")
|
IO.puts("Moderator status of #{nickname}: #{user.info.is_moderator}")
|
||||||
|
|
|
@ -18,8 +18,11 @@ def run([nickname | rest]) do
|
||||||
|
|
||||||
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
||||||
info_cng = User.Info.admin_api_update(user.info, %{is_admin: !!admin})
|
info_cng = User.Info.admin_api_update(user.info, %{is_admin: !!admin})
|
||||||
user_cng = Ecto.Changeset.change(user)
|
|
||||||
|
user_cng =
|
||||||
|
Ecto.Changeset.change(user)
|
||||||
|> put_embed(:info, info_cng)
|
|> put_embed(:info, info_cng)
|
||||||
|
|
||||||
{:ok, user} = User.update_and_set_cache(user_cng)
|
{:ok, user} = User.update_and_set_cache(user_cng)
|
||||||
|
|
||||||
IO.puts("Admin status of #{nickname}: #{user.info.is_admin}")
|
IO.puts("Admin status of #{nickname}: #{user.info.is_admin}")
|
||||||
|
|
|
@ -24,8 +24,11 @@ def run([nickname | rest]) do
|
||||||
|
|
||||||
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
||||||
info_cng = User.Info.profile_update(user.info, %{locked: !!locked})
|
info_cng = User.Info.profile_update(user.info, %{locked: !!locked})
|
||||||
user_cng = Ecto.Changeset.change(user)
|
|
||||||
|
user_cng =
|
||||||
|
Ecto.Changeset.change(user)
|
||||||
|> put_embed(:info, info_cng)
|
|> put_embed(:info, info_cng)
|
||||||
|
|
||||||
{:ok, user} = User.update_and_set_cache(user_cng)
|
{:ok, user} = User.update_and_set_cache(user_cng)
|
||||||
|
|
||||||
IO.puts("Locked status of #{nickname}: #{user.info.locked}")
|
IO.puts("Locked status of #{nickname}: #{user.info.locked}")
|
||||||
|
|
Loading…
Reference in a new issue