Fix toggle_activated in mix task User
authorlink0ff <juri@linkov.net>
Wed, 12 Dec 2018 20:30:16 +0000 (22:30 +0200)
committerlink0ff <juri@linkov.net>
Wed, 12 Dec 2018 20:30:16 +0000 (22:30 +0200)
lib/mix/tasks/pleroma/user.ex

index 2675b021df2f9ed0f87dff24bff68d5149b90468..bcc3b9e504865fa554507548fbe9668b947db338 100644 (file)
@@ -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}")