removing 410 status
authorAlexander Strizhakov <alex.strizhakov@gmail.com>
Wed, 13 May 2020 08:11:10 +0000 (11:11 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Mon, 18 May 2020 07:34:50 +0000 (10:34 +0300)
lib/pleroma/web/api_spec/operations/account_operation.ex
lib/pleroma/web/mastodon_api/controllers/account_controller.ex
test/web/mastodon_api/controllers/account_controller_test.exs

index 43168acf7f87af7670fb5feada0aa1dc8391de6c..74b395dfe97a0d8bffedd14d3abf07fb2c485b40 100644 (file)
@@ -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
index ffa82731f2d8e90adb6d74c3c7b976973667f22d..1edc0d96aa0133062f09d80c2a8cbc3bcc443606 100644 (file)
@@ -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")
 
index 7dfea2f9ec8aa90bf0ed554e17448f889050985c..8700ab2f5289532d7735292d3675233717d45b0a 100644 (file)
@@ -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