- Params: none
- Response:
- On failure:
- - 400 Bad Request `"To use this endpoint you need to enable dynamic configuration."`
+ - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
```json
{}
- Params: none
- Response:
- On failure:
- - 400 Bad Request `"To use this endpoint you need to enable dynamic configuration."`
- - 400 Bad Request `"To use dynamic configuration migrate your settings to database."`
+ - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
+ - 400 Bad Request `"To use configuration from database migrate your settings to database."`
```json
{
- Response:
- On failure:
- - 400 Bad Request `"To use this endpoint you need to enable dynamic configuration."`
+ - 400 Bad Request `"To use this endpoint you need to enable configuration from database."`
```json
{
configs: [
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)
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
%{conn: assign(conn, :user, admin)}
end
- test "when dynamic configuration is off", %{conn: conn} do
+ test "when configuration from database is off", %{conn: conn} do
initial = Pleroma.Config.get([:configurable_from_database])
Pleroma.Config.put([:configurable_from_database], false)
on_exit(fn -> Pleroma.Config.put([:configurable_from_database], initial) end)
conn = get(conn, "/api/pleroma/admin/config")
assert json_response(conn, 400) ==
- "To use this endpoint you need to enable dynamic configuration."
+ "To use this endpoint you need to enable configuration from database."
end
test "without any settings in db", %{conn: conn} do
conn = get(conn, "/api/pleroma/admin/config")
assert json_response(conn, 400) ==
- "To use dynamic configuration migrate your settings to database."
+ "To use configuration from database migrate your settings to database."
end
test "with settings in db", %{conn: conn} do
|> post("/api/pleroma/admin/config", %{"configs" => []})
assert json_response(conn, 400) ==
- "To use this endpoint you need to enable dynamic configuration."
+ "To use this endpoint you need to enable configuration from database."
end
describe "POST /api/pleroma/admin/config" do
assert Repo.all(Pleroma.Web.AdminAPI.Config) == []
end
- test "returns error if dynamic configuration is off", %{conn: conn} do
+ test "returns error if configuration from database is off", %{conn: conn} do
initial = Pleroma.Config.get([:configurable_from_database])
on_exit(fn -> Pleroma.Config.put([:configurable_from_database], initial) end)
Pleroma.Config.put([:configurable_from_database], false)
conn = get(conn, "/api/pleroma/admin/config/migrate_from_db")
assert json_response(conn, 400) ==
- "To use this endpoint you need to enable dynamic configuration."
+ "To use this endpoint you need to enable configuration from database."
end
end