admin: Show deleted users in circle members

This helps with removing those users from circles, to avoid them
popping up in peoples roster again.

Even though removal from a circle also only partially works
(roster entries are for instance not cleared), this helps with
ghost users reappearing all the time.
This commit is contained in:
Jonas Schäfer
2021-06-17 17:03:41 +02:00
parent 9d26e39025
commit 3d62efccfc
3 changed files with 36 additions and 24 deletions

View File

@@ -485,21 +485,21 @@ async def edit_circle(id_: str) -> typing.Union[str, quart.Response]:
return redirect(url_for(".circles"))
raise
users = sorted(
await client.list_users(),
key=lambda x: x.localpart
)
users = {
user.localpart: user
for user in await client.list_users()
}
circle_members = [
user for user in users
if user.localpart in circle.members
(localpart, users.get(localpart))
for localpart in sorted(circle.members)
]
form = EditCircleForm()
form.user_to_add.choices = [
(user.localpart, user.localpart)
for user in users
if user.localpart not in circle.members
]
form.user_to_add.choices = sorted(
(localpart, localpart)
for localpart in users.keys()
if localpart not in circle.members
)
valid_users = [x[0] for x in form.user_to_add.choices]
invite_form = InvitePost()