diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-07-15 11:00:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-15 11:00:21 -0400 |
commit | 8c7d0f163d8247297dbcfd5f257b652ebe417fff (patch) | |
tree | c3df5390d9919b2d9f2740a3c254f220f853bd7b /synapse/rest/admin/users.py | |
parent | Fix client reader sharding tests (#7853) (diff) | |
download | synapse-8c7d0f163d8247297dbcfd5f257b652ebe417fff.tar.xz |
Allow accounts to be re-activated from the admin APIs. (#7847)
Diffstat (limited to 'synapse/rest/admin/users.py')
-rw-r--r-- | synapse/rest/admin/users.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/rest/admin/users.py b/synapse/rest/admin/users.py index e4330c39d6..cc0bdfa5c9 100644 --- a/synapse/rest/admin/users.py +++ b/synapse/rest/admin/users.py @@ -239,6 +239,15 @@ class UserRestServletV2(RestServlet): await self.deactivate_account_handler.deactivate_account( target_user.to_string(), False ) + elif not deactivate and user["deactivated"]: + if "password" not in body: + raise SynapseError( + 400, "Must provide a password to re-activate an account." + ) + + await self.deactivate_account_handler.activate_account( + target_user.to_string() + ) user = await self.admin_handler.get_user(target_user) return 200, user @@ -254,7 +263,6 @@ class UserRestServletV2(RestServlet): admin = body.get("admin", None) user_type = body.get("user_type", None) displayname = body.get("displayname", None) - threepids = body.get("threepids", None) if user_type is not None and user_type not in UserTypes.ALL_USER_TYPES: raise SynapseError(400, "Invalid user type") |