aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api
diff options
context:
space:
mode:
authorEgor <egor@kislitsyn.com>2019-04-22 07:20:43 +0000
committerkaniini <nenolod@gmail.com>2019-04-22 07:20:43 +0000
commitb9cdf6d3b9940fded7d6be9f8771fd9c211afdd4 (patch)
tree4cb4fc190215842d6a14c4a202ff2fda32cc223a /lib/pleroma/web/common_api
parent05862ded7a156ad6db16a70ec90045a2149da97d (diff)
downloadpleroma-b9cdf6d3b9940fded7d6be9f8771fd9c211afdd4.tar.gz
Use `User.get_cached*` everywhere
Diffstat (limited to 'lib/pleroma/web/common_api')
-rw-r--r--lib/pleroma/web/common_api/common_api.ex2
-rw-r--r--lib/pleroma/web/common_api/utils.ex2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
index 6458a3449..cfbc5dc10 100644
--- a/lib/pleroma/web/common_api/common_api.ex
+++ b/lib/pleroma/web/common_api/common_api.ex
@@ -284,7 +284,7 @@ defmodule Pleroma.Web.CommonAPI do
def report(user, data) do
with {:account_id, %{"account_id" => account_id}} <- {:account_id, data},
- {:account, %User{} = account} <- {:account, User.get_by_id(account_id)},
+ {:account, %User{} = account} <- {:account, User.get_cached_by_id(account_id)},
{:ok, {content_html, _, _}} <- make_report_content_html(data["comment"]),
{:ok, statuses} <- get_report_statuses(account, data),
{:ok, activity} <-
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index 25f498fcb..0852896d0 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -284,7 +284,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
end
def confirm_current_password(user, password) do
- with %User{local: true} = db_user <- User.get_by_id(user.id),
+ with %User{local: true} = db_user <- User.get_cached_by_id(user.id),
true <- Pbkdf2.checkpw(password, db_user.password_hash) do
{:ok, db_user}
else