Merge branch 'fix/credo-issues' into 'develop'
Fix credo issues See merge request pleroma/pleroma!786
This commit is contained in:
commit
6c8d15da11
73 changed files with 397 additions and 228 deletions
|
|
@ -4,14 +4,19 @@
|
|||
|
||||
defmodule Pleroma.Web.TwitterAPI.UtilController do
|
||||
use Pleroma.Web, :controller
|
||||
|
||||
require Logger
|
||||
|
||||
alias Comeonin.Pbkdf2
|
||||
alias Pleroma.Emoji
|
||||
alias Pleroma.PasswordResetToken
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Repo
|
||||
alias Pleroma.Web
|
||||
alias Pleroma.Web.CommonAPI
|
||||
alias Pleroma.Web.OStatus
|
||||
alias Pleroma.Web.WebFinger
|
||||
alias Pleroma.Web.CommonAPI
|
||||
alias Comeonin.Pbkdf2
|
||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
alias Pleroma.{Repo, PasswordResetToken, User, Emoji}
|
||||
|
||||
def show_password_reset(conn, %{"token" => token}) do
|
||||
with %{used: false} = token <- Repo.get_by(PasswordResetToken, %{token: token}),
|
||||
|
|
|
|||
|
|
@ -2,16 +2,20 @@
|
|||
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
# FIXME: Remove this module?
|
||||
# THIS MODULE IS DEPRECATED! DON'T USE IT!
|
||||
# USE THE Pleroma.Web.TwitterAPI.Views.ActivityView MODULE!
|
||||
defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
|
||||
use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
|
||||
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
|
||||
alias Pleroma.{Activity, User}
|
||||
alias Pleroma.Web.TwitterAPI.{TwitterAPI, UserView, ActivityView}
|
||||
alias Pleroma.Web.CommonAPI.Utils
|
||||
alias Pleroma.Activity
|
||||
alias Pleroma.Formatter
|
||||
alias Pleroma.HTML
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.TwitterAPI.ActivityView
|
||||
alias Pleroma.Web.TwitterAPI.TwitterAPI
|
||||
alias Pleroma.Web.TwitterAPI.UserView
|
||||
alias Pleroma.Web.CommonAPI.Utils
|
||||
alias Pleroma.Web.MastodonAPI.StatusView
|
||||
|
||||
defp user_by_ap_id(user_list, ap_id) do
|
||||
|
|
|
|||
|
|
@ -3,8 +3,13 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
|
||||
alias Pleroma.{UserInviteToken, User, Activity, Repo, Object}
|
||||
alias Pleroma.{UserEmail, Mailer}
|
||||
alias Pleroma.UserInviteToken
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Activity
|
||||
alias Pleroma.Repo
|
||||
alias Pleroma.Object
|
||||
alias Pleroma.UserEmail
|
||||
alias Pleroma.Mailer
|
||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
alias Pleroma.Web.TwitterAPI.UserView
|
||||
alias Pleroma.Web.CommonAPI
|
||||
|
|
|
|||
|
|
@ -7,12 +7,19 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
|
||||
import Pleroma.Web.ControllerHelper, only: [json_response: 3]
|
||||
|
||||
alias Pleroma.Web.TwitterAPI.{TwitterAPI, UserView, ActivityView, NotificationView}
|
||||
alias Pleroma.Web.CommonAPI
|
||||
alias Pleroma.{Repo, Activity, Object, User, Notification}
|
||||
alias Ecto.Changeset
|
||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
alias Pleroma.Web.ActivityPub.Utils
|
||||
alias Ecto.Changeset
|
||||
alias Pleroma.Web.CommonAPI
|
||||
alias Pleroma.Web.TwitterAPI.ActivityView
|
||||
alias Pleroma.Web.TwitterAPI.NotificationView
|
||||
alias Pleroma.Web.TwitterAPI.TwitterAPI
|
||||
alias Pleroma.Web.TwitterAPI.UserView
|
||||
alias Pleroma.Activity
|
||||
alias Pleroma.Object
|
||||
alias Pleroma.Notification
|
||||
alias Pleroma.Repo
|
||||
alias Pleroma.User
|
||||
|
||||
require Logger
|
||||
|
||||
|
|
|
|||
|
|
@ -4,19 +4,18 @@
|
|||
|
||||
defmodule Pleroma.Web.TwitterAPI.ActivityView do
|
||||
use Pleroma.Web, :view
|
||||
alias Pleroma.Web.CommonAPI.Utils
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.TwitterAPI.UserView
|
||||
alias Pleroma.Web.TwitterAPI.ActivityView
|
||||
alias Pleroma.Web.TwitterAPI.TwitterAPI
|
||||
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
|
||||
alias Pleroma.Web.MastodonAPI.StatusView
|
||||
alias Pleroma.Activity
|
||||
alias Pleroma.Formatter
|
||||
alias Pleroma.HTML
|
||||
alias Pleroma.Object
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Repo
|
||||
alias Pleroma.Formatter
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.CommonAPI.Utils
|
||||
alias Pleroma.Web.MastodonAPI.StatusView
|
||||
alias Pleroma.Web.TwitterAPI.ActivityView
|
||||
alias Pleroma.Web.TwitterAPI.TwitterAPI
|
||||
alias Pleroma.Web.TwitterAPI.UserView
|
||||
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
|
||||
|
||||
import Ecto.Query
|
||||
require Logger
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
|
||||
defmodule Pleroma.Web.TwitterAPI.NotificationView do
|
||||
use Pleroma.Web, :view
|
||||
alias Pleroma.{Notification, User}
|
||||
alias Pleroma.Notification
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.CommonAPI.Utils
|
||||
alias Pleroma.Web.TwitterAPI.UserView
|
||||
alias Pleroma.Web.TwitterAPI.ActivityView
|
||||
alias Pleroma.Web.TwitterAPI.UserView
|
||||
|
||||
defp get_user(ap_id, opts) do
|
||||
cond do
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
defmodule Pleroma.Web.TwitterAPI.UserView do
|
||||
use Pleroma.Web, :view
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Formatter
|
||||
alias Pleroma.HTML
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.CommonAPI.Utils
|
||||
alias Pleroma.Web.MediaProxy
|
||||
alias Pleroma.HTML
|
||||
|
||||
def render("show.json", %{user: user = %User{}} = assigns) do
|
||||
render_one(user, Pleroma.Web.TwitterAPI.UserView, "user.json", assigns)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue