pre-commit: run black without string normalization

This commit is contained in:
Erik Sundell
2021-11-01 09:42:45 +01:00
parent e75de14839
commit 771ae59636
32 changed files with 691 additions and 587 deletions

View File

@@ -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]
)