removing 410 status

This commit is contained in:
Alexander Strizhakov 2020-05-13 11:11:10 +03:00
parent e7bc2f980c
commit b1aa402229
No known key found for this signature in database
GPG Key ID: 022896A53AEF1381
3 changed files with 6 additions and 11 deletions

View File

@ -103,8 +103,7 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
responses: %{ responses: %{
200 => Operation.response("Account", "application/json", Account), 200 => Operation.response("Account", "application/json", Account),
401 => Operation.response("Error", "application/json", ApiError), 401 => Operation.response("Error", "application/json", ApiError),
404 => Operation.response("Error", "application/json", ApiError), 404 => Operation.response("Error", "application/json", ApiError)
410 => Operation.response("Error", "application/json", ApiError)
} }
} }
end end
@ -145,8 +144,7 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
responses: %{ responses: %{
200 => Operation.response("Statuses", "application/json", array_of_statuses()), 200 => Operation.response("Statuses", "application/json", array_of_statuses()),
401 => Operation.response("Error", "application/json", ApiError), 401 => Operation.response("Error", "application/json", ApiError),
404 => Operation.response("Error", "application/json", ApiError), 404 => Operation.response("Error", "application/json", ApiError)
410 => Operation.response("Error", "application/json", ApiError)
} }
} }
end end

View File

@ -256,9 +256,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
defp user_visibility_error(conn, error) do defp user_visibility_error(conn, error) do
case error do case error do
:deactivated ->
render_error(conn, :gone, "")
:restrict_unauthenticated -> :restrict_unauthenticated ->
render_error(conn, :unauthorized, "This API requires an authenticated user") render_error(conn, :unauthorized, "This API requires an authenticated user")

View File

@ -131,10 +131,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
test "returns 401 for deactivated user", %{conn: conn} do test "returns 401 for deactivated user", %{conn: conn} do
user = insert(:user, deactivated: true) user = insert(:user, deactivated: true)
assert %{} = assert %{"error" => "Can't find user"} =
conn conn
|> get("/api/v1/accounts/#{user.id}") |> get("/api/v1/accounts/#{user.id}")
|> json_response_and_validate_schema(:gone) |> json_response_and_validate_schema(:not_found)
end end
end end
@ -261,10 +261,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
test "deactivated user", %{conn: conn} do test "deactivated user", %{conn: conn} do
user = insert(:user, deactivated: true) user = insert(:user, deactivated: true)
assert %{} == assert %{"error" => "Can't find user"} ==
conn conn
|> get("/api/v1/accounts/#{user.id}/statuses") |> get("/api/v1/accounts/#{user.id}/statuses")
|> json_response_and_validate_schema(:gone) |> json_response_and_validate_schema(:not_found)
end end
test "returns 404 when user is invisible", %{conn: conn} do test "returns 404 when user is invisible", %{conn: conn} do