Fix toggle_activated in mix task User

This commit is contained in:
link0ff 2018-12-12 22:30:16 +02:00
parent 2592b3c81a
commit a40ba3ba57

View file

@ -142,8 +142,11 @@ def run(["toggle_activated", nickname]) do
Common.start_pleroma() Common.start_pleroma()
with %User{} = user <- User.get_by_nickname(nickname) do with %User{} = user <- User.get_by_nickname(nickname) do
User.deactivate(user, !user.info["deactivated"]) {:ok, user} = User.deactivate(user, !user.info.deactivated)
Mix.shell().info("Activation status of #{nickname}: #{user.info["deactivated"]}")
Mix.shell().info(
"Activation status of #{nickname}: #{if(user.info.deactivated, do: "de", else: "")}activated"
)
else else
_ -> _ ->
Mix.shell().error("No user #{nickname}") Mix.shell().error("No user #{nickname}")