aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Strizhakov <alex.strizhakov@gmail.com>2020-05-13 11:11:10 +0300
committerAlexander Strizhakov <alex.strizhakov@gmail.com>2020-05-18 10:34:50 +0300
commitb1aa402229b6422a5ab1aa7102c7a104e218d0e3 (patch)
tree57bb8e355f77482a6757109e3a41b8d0f64a7b20
parente7bc2f980cce170731960e024614c497b821fe90 (diff)
downloadpleroma-b1aa402229b6422a5ab1aa7102c7a104e218d0e3.tar.gz
removing 410 status
-rw-r--r--lib/pleroma/web/api_spec/operations/account_operation.ex6
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/account_controller.ex3
-rw-r--r--test/web/mastodon_api/controllers/account_controller_test.exs8
3 files changed, 6 insertions, 11 deletions
diff --git a/lib/pleroma/web/api_spec/operations/account_operation.ex b/lib/pleroma/web/api_spec/operations/account_operation.ex
index 43168acf7..74b395dfe 100644
--- a/lib/pleroma/web/api_spec/operations/account_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/account_operation.ex
@@ -103,8 +103,7 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
responses: %{
200 => Operation.response("Account", "application/json", Account),
401 => Operation.response("Error", "application/json", ApiError),
- 404 => Operation.response("Error", "application/json", ApiError),
- 410 => Operation.response("Error", "application/json", ApiError)
+ 404 => Operation.response("Error", "application/json", ApiError)
}
}
end
@@ -145,8 +144,7 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
responses: %{
200 => Operation.response("Statuses", "application/json", array_of_statuses()),
401 => Operation.response("Error", "application/json", ApiError),
- 404 => Operation.response("Error", "application/json", ApiError),
- 410 => Operation.response("Error", "application/json", ApiError)
+ 404 => Operation.response("Error", "application/json", ApiError)
}
}
end
diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
index ffa82731f..1edc0d96a 100644
--- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
@@ -256,9 +256,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
defp user_visibility_error(conn, error) do
case error do
- :deactivated ->
- render_error(conn, :gone, "")
-
:restrict_unauthenticated ->
render_error(conn, :unauthorized, "This API requires an authenticated user")
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs
index 7dfea2f9e..8700ab2f5 100644
--- a/test/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/web/mastodon_api/controllers/account_controller_test.exs
@@ -131,10 +131,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
test "returns 401 for deactivated user", %{conn: conn} do
user = insert(:user, deactivated: true)
- assert %{} =
+ assert %{"error" => "Can't find user"} =
conn
|> get("/api/v1/accounts/#{user.id}")
- |> json_response_and_validate_schema(:gone)
+ |> json_response_and_validate_schema(:not_found)
end
end
@@ -261,10 +261,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
test "deactivated user", %{conn: conn} do
user = insert(:user, deactivated: true)
- assert %{} ==
+ assert %{"error" => "Can't find user"} ==
conn
|> get("/api/v1/accounts/#{user.id}/statuses")
- |> json_response_and_validate_schema(:gone)
+ |> json_response_and_validate_schema(:not_found)
end
test "returns 404 when user is invisible", %{conn: conn} do