From 70d1b6abff125c0dd5022d1394548ee12367b371 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Thu, 11 Mar 2021 14:52:32 +0100 Subject: [PATCH] Re-Activating account when local passwords are disabled (#9587) Fixes: #8393 --- changelog.d/9587.bugfix | 1 + synapse/rest/admin/users.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog.d/9587.bugfix diff --git a/changelog.d/9587.bugfix b/changelog.d/9587.bugfix new file mode 100644 index 000000000000..d8f04c4f2114 --- /dev/null +++ b/changelog.d/9587.bugfix @@ -0,0 +1 @@ +Re-Activating account with admin API when local passwords are disabled. \ No newline at end of file diff --git a/synapse/rest/admin/users.py b/synapse/rest/admin/users.py index 267a993430eb..2c89b62e254a 100644 --- a/synapse/rest/admin/users.py +++ b/synapse/rest/admin/users.py @@ -269,7 +269,10 @@ async def on_PUT( target_user.to_string(), False, requester, by_admin=True ) elif not deactivate and user["deactivated"]: - if "password" not in body: + if ( + "password" not in body + and self.hs.config.password_localdb_enabled + ): raise SynapseError( 400, "Must provide a password to re-activate an account." )