diff options
author | lambda <lain@soykaf.club> | 2019-04-02 10:52:29 +0000 |
---|---|---|
committer | lambda <lain@soykaf.club> | 2019-04-02 10:52:29 +0000 |
commit | 26d509cc861ad865b12d187fc163fa78c4c128a7 (patch) | |
tree | afdc885e17def5b2f65c3dbc8c33aa595f06026b /lib/pleroma/web/common_api | |
parent | b5d486d9ac40c051c23d23ef5a48685d08127904 (diff) | |
parent | 11c2d6bdc458d40616e677ff71e471bd827344ee (diff) | |
download | pleroma-26d509cc861ad865b12d187fc163fa78c4c128a7.tar.gz |
Merge branch 'get_by_id' into 'develop'
Replace `Repo.get(Module, id)` with `Module.get_by_id(id)` where possible
See merge request pleroma/pleroma!1009
Diffstat (limited to 'lib/pleroma/web/common_api')
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index f596f703b..40cea3090 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -31,7 +31,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do def get_replied_to_activity(""), do: nil def get_replied_to_activity(id) when not is_nil(id) do - Repo.get(Activity, id) + Activity.get_by_id(id) end def get_replied_to_activity(_), do: nil @@ -275,7 +275,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do end def confirm_current_password(user, password) do - with %User{local: true} = db_user <- Repo.get(User, user.id), + with %User{local: true} = db_user <- User.get_by_id(user.id), true <- Pbkdf2.checkpw(password, db_user.password_hash) do {:ok, db_user} else |