change Repo.get(User, id) => User.get_by_id(id)

This commit is contained in:
Egor Kislitsyn 2019-04-02 17:01:26 +07:00
commit 1b3d921921
23 changed files with 110 additions and 114 deletions

View file

@ -108,7 +108,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
fixed_token = fix_padding(params["code"]),
%Authorization{} = auth <-
Repo.get_by(Authorization, token: fixed_token, app_id: app.id),
%User{} = user <- Repo.get(User, auth.user_id),
%User{} = user <- User.get_by_id(auth.user_id),
{:ok, token} <- Token.exchange_token(app, auth),
{:ok, inserted_at} <- DateTime.from_naive(token.inserted_at, "Etc/UTC") do
response = %{