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
1 changed files with 5 additions and 2 deletions

View File

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