diff options
author | Patrick Cloke <patrickc@matrix.org> | 2023-10-16 15:42:54 -0400 |
---|---|---|
committer | Patrick Cloke <patrickc@matrix.org> | 2023-10-16 15:42:54 -0400 |
commit | c1878cd4ae7fec1d7b090b4b45698ce36bcd3726 (patch) | |
tree | 2de86373f8b7516a69ac910597a2a514ec41afd5 /synapse/rest/admin/users.py | |
parent | Merge branch 'develop' into clokep/db-upgrades (diff) | |
parent | Update the release script to remind releaser to check for special release not... (diff) | |
download | synapse-c1878cd4ae7fec1d7b090b4b45698ce36bcd3726.tar.xz |
Merge remote-tracking branch 'origin/develop' into clokep/db-upgrades
Diffstat (limited to 'synapse/rest/admin/users.py')
-rw-r--r-- | synapse/rest/admin/users.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/synapse/rest/admin/users.py b/synapse/rest/admin/users.py index 5b743a1d03..7fe16130e7 100644 --- a/synapse/rest/admin/users.py +++ b/synapse/rest/admin/users.py @@ -329,9 +329,8 @@ class UserRestServletV2(RestServlet): if threepids is not None: # get changed threepids (added and removed) - # convert List[Dict[str, Any]] into Set[Tuple[str, str]] cur_threepids = { - (threepid["medium"], threepid["address"]) + (threepid.medium, threepid.address) for threepid in await self.store.user_get_threepids(user_id) } add_threepids = new_threepids - cur_threepids @@ -842,7 +841,18 @@ class SearchUsersRestServlet(RestServlet): logger.info("term: %s ", term) ret = await self.store.search_users(term) - return HTTPStatus.OK, ret + results = [ + { + "name": name, + "password_hash": password_hash, + "is_guest": bool(is_guest), + "admin": bool(admin), + "user_type": user_type, + } + for name, password_hash, is_guest, admin, user_type in ret + ] + + return HTTPStatus.OK, results class UserAdminServlet(RestServlet): |