From: link0ff Date: Wed, 12 Dec 2018 20:30:16 +0000 (+0200) Subject: Fix toggle_activated in mix task User X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=a40ba3ba57158401583c5f80aaa78d80b4ca319f;p=akkoma Fix toggle_activated in mix task User --- diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex index 2675b021d..bcc3b9e50 100644 --- a/lib/mix/tasks/pleroma/user.ex +++ b/lib/mix/tasks/pleroma/user.ex @@ -142,8 +142,11 @@ defmodule Mix.Tasks.Pleroma.User 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}")