Add "local" to users admin API
authorMaxim Filippov <colixer@gmail.com>
Wed, 13 Mar 2019 13:04:44 +0000 (16:04 +0300)
committerMaxim Filippov <colixer@gmail.com>
Wed, 13 Mar 2019 13:04:44 +0000 (16:04 +0300)
lib/pleroma/web/mastodon_api/views/admin/account_view.ex
test/web/admin_api/admin_api_controller_test.exs

index 5ce0171249cae3158ee28b304f2a42a67add8535..1bed1108922721d2c6d38f9010c399ea4e17d4f5 100644 (file)
@@ -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
index 0470a439bef958b5a541ddc0e8d43a1ba46dcd10..c72e6b9755f3fc1a05499ac53dd1cde856a63278 100644 (file)
@@ -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