From: Maxim Filippov Date: Wed, 13 Mar 2019 13:04:44 +0000 (+0300) Subject: Add "local" to users admin API X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=490d9cf7b149bbb93f6065fc807eafd339bcc0ea;p=akkoma Add "local" to users admin API --- diff --git a/lib/pleroma/web/mastodon_api/views/admin/account_view.ex b/lib/pleroma/web/mastodon_api/views/admin/account_view.ex index 5ce017124..1bed11089 100644 --- a/lib/pleroma/web/mastodon_api/views/admin/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/admin/account_view.ex @@ -21,6 +21,7 @@ defmodule Pleroma.Web.MastodonAPI.Admin.AccountView do "id" => user.id, "nickname" => user.nickname, "deactivated" => user.info.deactivated, + "local" => user.local, "roles" => Info.roles(user.info) } end diff --git a/test/web/admin_api/admin_api_controller_test.exs b/test/web/admin_api/admin_api_controller_test.exs index 0470a439b..c72e6b975 100644 --- a/test/web/admin_api/admin_api_controller_test.exs +++ b/test/web/admin_api/admin_api_controller_test.exs @@ -394,7 +394,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do "deactivated" => user.info.deactivated, "id" => user.id, "nickname" => user.nickname, - "roles" => %{"admin" => false, "moderator" => false} + "roles" => %{"admin" => false, "moderator" => false}, + "local" => true } ] } @@ -418,7 +419,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do "deactivated" => user.info.deactivated, "id" => user.id, "nickname" => user.nickname, - "roles" => %{"admin" => false, "moderator" => false} + "roles" => %{"admin" => false, "moderator" => false}, + "local" => true } ] } @@ -436,7 +438,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do "deactivated" => user2.info.deactivated, "id" => user2.id, "nickname" => user2.nickname, - "roles" => %{"admin" => false, "moderator" => false} + "roles" => %{"admin" => false, "moderator" => false}, + "local" => true } ] } @@ -461,7 +464,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do "deactivated" => user.info.deactivated, "id" => user.id, "nickname" => user.nickname, - "roles" => %{"admin" => false, "moderator" => false} + "roles" => %{"admin" => false, "moderator" => false}, + "local" => true } ] } @@ -486,13 +490,15 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do "deactivated" => admin.info.deactivated, "id" => admin.id, "nickname" => admin.nickname, - "roles" => %{"admin" => true, "moderator" => false} + "roles" => %{"admin" => true, "moderator" => false}, + "local" => true }, %{ "deactivated" => user.info.deactivated, "id" => user.id, "nickname" => user.nickname, - "roles" => %{"admin" => false, "moderator" => false} + "roles" => %{"admin" => false, "moderator" => false}, + "local" => true } ] } @@ -513,7 +519,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do "deactivated" => !user.info.deactivated, "id" => user.id, "nickname" => user.nickname, - "roles" => %{"admin" => false, "moderator" => false} + "roles" => %{"admin" => false, "moderator" => false}, + "local" => true } end end