From e3a21bcd45dd1f27a2f6a74041d86c64ad8256e9 Mon Sep 17 00:00:00 2001 From: Ivan Tashkinov Date: Wed, 12 Dec 2018 17:14:31 +0300 Subject: [PATCH] [#114] Addressed warnings. Fix of `with` statement clause in `password_reset`. --- lib/pleroma/web/twitter_api/twitter_api_controller.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index 8837db566..479c92381 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -3,7 +3,6 @@ defmodule Pleroma.Web.TwitterAPI.Controller do import Pleroma.Web.ControllerHelper, only: [json_response: 3] - alias Pleroma.Formatter alias Pleroma.Web.TwitterAPI.{TwitterAPI, UserView, ActivityView, NotificationView} alias Pleroma.Web.CommonAPI alias Pleroma.{Repo, Activity, Object, User, Notification} @@ -329,7 +328,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do def password_reset(conn, params) do nickname_or_email = params["email"] || params["nickname"] - with is_binary(nickname_or_email), + with true <- is_binary(nickname_or_email), %User{local: true} = user <- User.get_by_nickname_or_email(nickname_or_email) do {:ok, token_record} = Pleroma.PasswordResetToken.create_token(user) -- 2.45.2