mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
pre-commit: run black without string normalization
This commit is contained in:
@@ -10,7 +10,7 @@ def generate_system_username(username):
|
||||
|
||||
If username < 26 char, we just return it.
|
||||
Else, we hash the username, truncate username at
|
||||
26 char, append a '-' and first add 5char of hash.
|
||||
26 char, append a '-' and first add 5char of hash.
|
||||
This makes sure our usernames are always under 32char.
|
||||
"""
|
||||
|
||||
@@ -19,6 +19,5 @@ def generate_system_username(username):
|
||||
|
||||
userhash = hashlib.sha256(username.encode('utf-8')).hexdigest()
|
||||
return '{username_trunc}-{hash}'.format(
|
||||
username_trunc=username[:26],
|
||||
hash=userhash[:5]
|
||||
)
|
||||
username_trunc=username[:26], hash=userhash[:5]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user