From a40ba3ba57158401583c5f80aaa78d80b4ca319f Mon Sep 17 00:00:00 2001 From: link0ff Date: Wed, 12 Dec 2018 22:30:16 +0200 Subject: [PATCH] Fix toggle_activated in mix task User --- lib/mix/tasks/pleroma/user.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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}") -- 2.45.2