Update majic & call plug before OpenApiSpex
authorhref <href@random.sh>
Tue, 16 Jun 2020 17:00:54 +0000 (19:00 +0200)
committerhref <href@random.sh>
Tue, 16 Jun 2020 17:00:54 +0000 (19:00 +0200)
lib/pleroma/web/mastodon_api/controllers/media_controller.ex
lib/pleroma/web/pleroma_api/controllers/account_controller.ex
lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex
mix.lock

index 06bb718efbb383e35c73d0a45d49ba76b26cd738..09acea7f49fbab66d791da7102ca42e3760a9f2d 100644 (file)
@@ -11,12 +11,12 @@ defmodule Pleroma.Web.MastodonAPI.MediaController do
   alias Pleroma.Web.ActivityPub.ActivityPub
 
   action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
+  plug(Majic.Plug, [pool: Pleroma.MajicPool] when action in [:create, :create2])
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   plug(:put_view, Pleroma.Web.MastodonAPI.StatusView)
 
   plug(OAuthScopesPlug, %{scopes: ["read:media"]} when action == :show)
   plug(OAuthScopesPlug, %{scopes: ["write:media"]} when action != :show)
-  plug(Majic.Plug, [pool: Pleroma.MajicPool] when action in [:create, :create2])
 
   defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.MediaOperation
 
index 97a6ae60db22925b11b98174105424cb9587295f..c76cbfc488cff69fb2dc2eea393821345be86f2d 100644 (file)
@@ -18,6 +18,11 @@ defmodule Pleroma.Web.PleromaAPI.AccountController do
 
   require Pleroma.Constants
 
+  plug(
+    Majic.Plug,
+    [pool: Pleroma.MajicPool] when action in [:update_avatar, :update_background, :update_banner]
+  )
+
   plug(
     OpenApiSpex.Plug.PutApiSpec,
     [module: Pleroma.Web.ApiSpec] when action == :confirmation_resend
@@ -56,11 +61,6 @@ defmodule Pleroma.Web.PleromaAPI.AccountController do
   plug(:assign_account_by_id when action in [:favourites, :subscribe, :unsubscribe])
   plug(:put_view, Pleroma.Web.MastodonAPI.AccountView)
 
-  plug(
-    Majic.Plug,
-    [pool: Pleroma.MajicPool] when action in [:update_avatar, :update_background, :update_banner]
-  )
-
   defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaAccountOperation
 
   @doc "POST /api/v1/pleroma/accounts/confirmation_resend"
index 4ba4154dd5e1b691b0329bcdeb68eda9cd028481..7e2f6c3284d9b53964213f47b0008ce5f181ebef 100644 (file)
@@ -9,10 +9,10 @@ defmodule Pleroma.Web.PleromaAPI.MascotController do
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
 
+  plug(Majic.Plug, [pool: Pleroma.MajicPool] when action in [:update])
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   plug(OAuthScopesPlug, %{scopes: ["read:accounts"]} when action == :show)
   plug(OAuthScopesPlug, %{scopes: ["write:accounts"]} when action != :show)
-  plug(Majic.Plug, [pool: Pleroma.MajicPool] when action in [:update])
 
   defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaMascotOperation
 
index 8ff41ebf677170ff2285a4f46ee3a11754fb4ecf..b69f7eb8e72674404a3fb500d0af0bcb459f1c21 100644 (file)
--- a/mix.lock
+++ b/mix.lock
@@ -63,7 +63,7 @@
   "jose": {:hex, :jose, "1.10.1", "16d8e460dae7203c6d1efa3f277e25b5af8b659febfc2f2eb4bacf87f128b80a", [:mix, :rebar3], [], "hexpm", "3c7ddc8a9394b92891db7c2771da94bf819834a1a4c92e30857b7d582e2f8257"},
   "jumper": {:hex, :jumper, "1.0.1", "3c00542ef1a83532b72269fab9f0f0c82bf23a35e27d278bfd9ed0865cecabff", [:mix], [], "hexpm", "318c59078ac220e966d27af3646026db9b5a5e6703cb2aa3e26bcfaba65b7433"},
   "libring": {:hex, :libring, "1.4.0", "41246ba2f3fbc76b3971f6bce83119dfec1eee17e977a48d8a9cfaaf58c2a8d6", [:mix], [], "hexpm"},
-  "majic": {:git, "https://github.com/hrefhref/majic", "1c723300364cd014866c6c1bd5260e03965865a2", [branch: "develop"]},
+  "majic": {:git, "https://github.com/hrefhref/majic", "91a10cfa0c902eb889584238a3ef5aa595c21ef8", [branch: "develop"]},
   "makeup": {:hex, :makeup, "1.0.0", "671df94cf5a594b739ce03b0d0316aa64312cee2574b6a44becb83cd90fb05dc", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "a10c6eb62cca416019663129699769f0c2ccf39428b3bb3c0cb38c718a0c186d"},
   "makeup_elixir": {:hex, :makeup_elixir, "0.14.0", "cf8b7c66ad1cff4c14679698d532f0b5d45a3968ffbcbfd590339cb57742f1ae", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "d4b316c7222a85bbaa2fd7c6e90e37e953257ad196dc229505137c5e505e9eff"},
   "meck": {:hex, :meck, "0.8.13", "ffedb39f99b0b99703b8601c6f17c7f76313ee12de6b646e671e3188401f7866", [:rebar3], [], "hexpm", "d34f013c156db51ad57cc556891b9720e6a1c1df5fe2e15af999c84d6cebeb1a"},