Fix Credo warnings
authorEgor Kislitsyn <egor@kislitsyn.com>
Tue, 24 Sep 2019 07:49:02 +0000 (14:49 +0700)
committerEgor Kislitsyn <egor@kislitsyn.com>
Tue, 24 Sep 2019 12:50:09 +0000 (19:50 +0700)
lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
lib/pleroma/web/twitter_api/twitter_api_controller.ex

index 8a528707982c0bfb5637848b1b2a58ff06039df0..873ef20bcc1625256e9355f8b2abf8b9c16f138c 100644 (file)
@@ -1348,7 +1348,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
   end
 
   def put_settings(%{assigns: %{user: user}} = conn, %{"data" => settings} = _params) do
-    with {:ok, _user} <- User.update_info(user, &User.Info.mastodon_settings_update(&1, settings)) do
+    with {:ok, _} <- User.update_info(user, &User.Info.mastodon_settings_update(&1, settings)) do
       json(conn, %{})
     else
       e ->
index aa06e263010e7d40d146b2182122c9dd15cc1685..5024ac70d821ebdf1528910d15f40bff56382936 100644 (file)
@@ -15,10 +15,11 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
   action_fallback(:errors)
 
   def confirm_email(conn, %{"user_id" => uid, "token" => token}) do
+    new_info = [need_confirmation: false]
+
     with %User{info: info} = user <- User.get_cached_by_id(uid),
          true <- user.local and info.confirmation_pending and info.confirmation_token == token,
-         {:ok, _} <-
-           User.update_info(user, &User.Info.confirmation_changeset(&1, need_confirmation: false)) do
+         {:ok, _} <- User.update_info(user, &User.Info.confirmation_changeset(&1, new_info)) do
       redirect(conn, to: "/")
     end
   end