add username normalization

Handlers call `get_authenticated_user`, which in turn calls

- authenticate
- normalize_username
- check_whitelist

get_authenticated_user shouldn't need to be overridden.

Normalization can be handled via overriding normalize_username.
This commit is contained in:
Min RK
2016-01-08 15:45:57 +01:00
parent 8a5a85a489
commit 887fdaf9d3
5 changed files with 80 additions and 21 deletions

View File

@@ -34,6 +34,7 @@ class UserListAPIHandler(APIHandler):
to_create = []
for name in usernames:
name = self.authenticator.normalize_username(name)
user = self.find_user(name)
if user is not None:
self.log.warn("User %s already exists" % name)