mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 03:34:56 -04:00
Return total number of users and profile attributes in admin users endpoint (#6881)
Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
This commit is contained in:
parent
fce663889b
commit
04dd7d182d
6 changed files with 98 additions and 34 deletions
|
@ -94,10 +94,10 @@ class UsersRestServletV2(RestServlet):
|
|||
guests = parse_boolean(request, "guests", default=True)
|
||||
deactivated = parse_boolean(request, "deactivated", default=False)
|
||||
|
||||
users = await self.store.get_users_paginate(
|
||||
users, total = await self.store.get_users_paginate(
|
||||
start, limit, user_id, guests, deactivated
|
||||
)
|
||||
ret = {"users": users}
|
||||
ret = {"users": users, "total": total}
|
||||
if len(users) >= limit:
|
||||
ret["next_token"] = str(start + len(users))
|
||||
|
||||
|
@ -199,7 +199,7 @@ class UserRestServletV2(RestServlet):
|
|||
user_id, threepid["medium"], threepid["address"], current_time
|
||||
)
|
||||
|
||||
if "avatar_url" in body:
|
||||
if "avatar_url" in body and type(body["avatar_url"]) == str:
|
||||
await self.profile_handler.set_avatar_url(
|
||||
target_user, requester, body["avatar_url"], True
|
||||
)
|
||||
|
@ -276,7 +276,7 @@ class UserRestServletV2(RestServlet):
|
|||
user_id, threepid["medium"], threepid["address"], current_time
|
||||
)
|
||||
|
||||
if "avatar_url" in body:
|
||||
if "avatar_url" in body and type(body["avatar_url"]) == str:
|
||||
await self.profile_handler.set_avatar_url(
|
||||
user_id, requester, body["avatar_url"], True
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue