Update terminology, add username check for later users

This commit is contained in:
Midgard 2020-12-06 02:36:21 +01:00
parent d88afa7a58
commit cf905a51d6
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -78,12 +78,10 @@ channel = channel_data["id"]
################################## ##################################
# Get users # Get users
# People who are authorized to grant pancakes # People who are authorized to do verifications
tagger_ids = {u["id"]: u["username"] for u in mm.get_users_by_usernames_list(TAGGERS)} tagger_ids = {u["id"]: u["username"] for u in mm.get_users_by_usernames_list(TAGGERS)}
users = {u["id"]: u for u in mm.get_users(in_channel=channel)} users = {u["id"]: u for u in mm.get_users(in_channel=channel)}
for user in users.values(): for user in users.values():
assert user["username"].find(" ") == -1, f"{user['username']} shouldn't have spaces in username" assert user["username"].find(" ") == -1, f"{user['username']} shouldn't have spaces in username"
@ -92,7 +90,9 @@ def get_username(userid):
if userid not in users: if userid not in users:
users[userid] = mm.get_user(userid) users[userid] = mm.get_user(userid)
return users[userid]["username"] username = users[userid]["username"]
assert username.find(" ") == -1, f"{username} shouldn't have spaces in username"
return username
################################## ##################################