little cleanup
[akkoma] / lib / pleroma / web / admin_api / admin_api_controller.ex
index 849641113baead98ff76580169c57abe946d8846..99fcc080ce69ce161e0baced9d8d3dddc046088e 100644 (file)
@@ -88,7 +88,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
   plug(
     OAuthScopesPlug,
     %{scopes: ["read"], admin: true}
-    when action in [:config_show, :migrate_to_db, :migrate_from_db, :list_log]
+    when action in [:config_show, :migrate_from_db, :list_log]
   )
 
   plug(
@@ -802,7 +802,10 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
       configs = Pleroma.Repo.all(Config)
 
       if configs == [] do
-        errors(conn, {:error, "To use dynamic configuration migrate your settings to database."})
+        errors(
+          conn,
+          {:error, "To use configuration from database migrate your settings to database."}
+        )
       else
         conn
         |> put_view(ConfigView)
@@ -844,10 +847,13 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
   end
 
   defp configurable_from_database(conn) do
-    if Pleroma.Config.get([:configurable_from_database]) do
+    if Pleroma.Config.get(:configurable_from_database) do
       :ok
     else
-      errors(conn, {:error, "To use this endpoint you need to enable dynamic configuration."})
+      errors(
+        conn,
+        {:error, "To use this endpoint you need to enable configuration from database."}
+      )
     end
   end