Improve error message for ConfigDB
This commit is contained in:
parent
7f07871639
commit
5fcab23aa3
|
@ -404,7 +404,7 @@ defp configurable_from_database do
|
||||||
if Config.get(:configurable_from_database) do
|
if Config.get(:configurable_from_database) do
|
||||||
:ok
|
:ok
|
||||||
else
|
else
|
||||||
{:error, "To use this endpoint you need to enable configuration from database."}
|
{:error, "You must enable configurable_from_database in your config file."}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ defp configurable_from_database do
|
||||||
if Config.get(:configurable_from_database) do
|
if Config.get(:configurable_from_database) do
|
||||||
:ok
|
:ok
|
||||||
else
|
else
|
||||||
{:error, "To use this endpoint you need to enable configuration from database."}
|
{:error, "You must enable configurable_from_database in your config file."}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ test "when configuration from database is off", %{conn: conn} do
|
||||||
|
|
||||||
assert json_response_and_validate_schema(conn, 400) ==
|
assert json_response_and_validate_schema(conn, 400) ==
|
||||||
%{
|
%{
|
||||||
"error" => "To use this endpoint you need to enable configuration from database."
|
"error" => "You must enable configurable_from_database in your config file."
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ test "POST /api/pleroma/admin/config with configdb disabled", %{conn: conn} do
|
||||||
|> post("/api/pleroma/admin/config", %{"configs" => []})
|
|> post("/api/pleroma/admin/config", %{"configs" => []})
|
||||||
|
|
||||||
assert json_response_and_validate_schema(conn, 400) ==
|
assert json_response_and_validate_schema(conn, 400) ==
|
||||||
%{"error" => "To use this endpoint you need to enable configuration from database."}
|
%{"error" => "You must enable configurable_from_database in your config file."}
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "POST /api/pleroma/admin/config" do
|
describe "POST /api/pleroma/admin/config" do
|
||||||
|
|
Loading…
Reference in a new issue