From 373c8040b12cc9e4c7b96e25cc4b166e8e700fa0 Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Wed, 8 Mar 2023 12:59:21 +0100 Subject: [PATCH] Check for None when setting admin in user_modify api method. Fixes a bug where setting an admin-enabled user back to a normal user is not possible (issue https://github.com/JOJ0/synadm/issues/100). --- synadm/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synadm/api.py b/synadm/api.py index c40a03fd..7fe11a52 100644 --- a/synadm/api.py +++ b/synadm/api.py @@ -550,7 +550,7 @@ def user_modify(self, user_id, password, display_name, threepid, ]}) if avatar_url: data.update({"avatar_url": avatar_url}) - if admin: + if admin is not None: data.update({"admin": admin}) if deactivation == "deactivate": data.update({"deactivated": True})