Fixed set a user as an admin with the new API (#6928)

Fix #6910
This commit is contained in:
Dirk Klimpel 2020-02-28 10:58:05 +01:00 committed by Richard van der Hoff
parent 380122866f
commit bbeee33d63
4 changed files with 195 additions and 39 deletions

View file

@ -211,9 +211,7 @@ class UserRestServletV2(RestServlet):
if target_user == auth_user and not set_admin_to:
raise SynapseError(400, "You may not demote yourself.")
await self.admin_handler.set_user_server_admin(
target_user, set_admin_to
)
await self.store.set_server_admin(target_user, set_admin_to)
if "password" in body:
if (
@ -648,6 +646,6 @@ class UserAdminServlet(RestServlet):
if target_user == auth_user and not set_admin_to:
raise SynapseError(400, "You may not demote yourself.")
await self.store.set_user_server_admin(target_user, set_admin_to)
await self.store.set_server_admin(target_user, set_admin_to)
return 200, {}