diff options
author | kaniini <nenolod@gmail.com> | 2019-04-22 07:20:43 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-04-22 07:20:43 +0000 |
commit | 0b6d1d920e5ca4fe840a8d1cad366cc8cc54360d (patch) | |
tree | 4cb4fc190215842d6a14c4a202ff2fda32cc223a /lib/pleroma/web/twitter_api/twitter_api_controller.ex | |
parent | 05862ded7a156ad6db16a70ec90045a2149da97d (diff) | |
parent | b9cdf6d3b9940fded7d6be9f8771fd9c211afdd4 (diff) | |
download | pleroma-0b6d1d920e5ca4fe840a8d1cad366cc8cc54360d.tar.gz |
Merge branch 'get-cached-everywhere' into 'develop'
Use `User.get_cached*` everywhere
See merge request pleroma/pleroma!1021
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api_controller.ex')
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api_controller.ex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index a7ec9949c..851f328fd 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -434,7 +434,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do end def confirm_email(conn, %{"user_id" => uid, "token" => token}) do - with %User{} = user <- User.get_by_id(uid), + with %User{} = user <- User.get_cached_by_id(uid), true <- user.local, true <- user.info.confirmation_pending, true <- user.info.confirmation_token == token, @@ -587,7 +587,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do def approve_friend_request(conn, %{"user_id" => uid} = _params) do with followed <- conn.assigns[:user], - %User{} = follower <- User.get_by_id(uid), + %User{} = follower <- User.get_cached_by_id(uid), {:ok, follower} <- CommonAPI.accept_follow_request(follower, followed) do conn |> put_view(UserView) @@ -599,7 +599,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do def deny_friend_request(conn, %{"user_id" => uid} = _params) do with followed <- conn.assigns[:user], - %User{} = follower <- User.get_by_id(uid), + %User{} = follower <- User.get_cached_by_id(uid), {:ok, follower} <- CommonAPI.reject_follow_request(follower, followed) do conn |> put_view(UserView) |